Prochaines Sessions
Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !
Démonstration de ProjeQtOr(gratuit, sur inscription)
13 mai 2025 (10h30-12h) 5 juin 2025 (16h-17h30) |
Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !
Démonstration de ProjeQtOr(gratuit, sur inscription)
13 mai 2025 (10h30-12h) 5 juin 2025 (16h-17h30) |
CREATE TABLE IF NOT EXISTS `country` (
`id` int(12) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(4) DEFAULT NULL,
`lang` varchar(2) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`idle` int(1) unsigned DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `countryCodeLang` (`code`,`lang`),
KEY `countryCode` (`code`),
KEY `countryLang` (`lang`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `country` VALUES(1, 'af', 'en', 'Afghanistan', 0);
INSERT INTO `country` VALUES(2, 'af', 'fr', 'Afghanistan', 0);
INSERT INTO `country` VALUES(3, 'al', 'en', 'Albania', 0);
INSERT INTO `country` VALUES(4, 'al', 'fr', 'Albanie', 0);
INSERT INTO `country` VALUES(5, 'dz', 'en', 'Algeria', 0);
INSERT INTO `country` VALUES(6, 'dz', 'fr', 'Algérie', 0);
INSERT INTO `country` VALUES(7, 'ad', 'en', 'Andorra', 0);
INSERT INTO `country` VALUES(8, 'ad', 'fr', 'Andorre', 0);
(…)
INSERT INTO `menu` VALUES(135, 'menuCountry', 36, 'object', 710, NULL, 0);
<?php
/* ============================================================================
* Country defines list of countries.
*/
require_once('_securityCheck.php');
class Country extends SqlElement {
// extends SqlElement, so has $id
public $_col_1_2_Description;
public $id; // redefine $id to specify its visible place
public $code;
public $lang;
public $name;
// Define the layout that will be used for lists
private static $_layout='
<th field="id" formatter="numericFormatter" width="10%"># ${id}</th>
<th field="code" width="10%">${code}</th>
<th field="lang" width="10%">${lang}</th>
<th field="name" width="70%">${name}</th>
';
private static $_fieldsAttributes=array("code"=>"required",
"lang"=>"required",
"name"=>"required"
);
/** ==========================================================================
* Constructor
* @param $id the id of the object in the database (null if not stored yet)
* @return void
*/
function __construct($id = NULL) {
parent::__construct($id);
}
/** ==========================================================================
* Destructor
* @return void
*/
function __destruct() {
parent::__destruct();
}
// ============================================================================**********
// GET STATIC DATA FUNCTIONS
// ============================================================================**********
/** ==========================================================================
* Return the specific layout
* @return the layout
*/
protected function getStaticLayout() {
return self::$_layout;
}
/** ==========================================================================
* Return the specific fieldsAttributes
* @return the fieldsAttributes
*/
protected function getStaticFieldsAttributes() {
return self::$_fieldsAttributes;
}
}
?>
public $idCountry;
Please Connexion or Create an account to join the conversation.
Yes, it is a way to disable some item wothout deleting itAs I understand, the ‘idle’ column is requested for use of the table in a combo box, is this true?
Yes : give access rights !1. This new table does not appears in main menu! What have I missed?
idCountry should be added in Client table as int(12) !… don’t build the link with the new table.
Please Connexion or Create an account to join the conversation.
But some menu entries – as Role and all other entries under Values lists… and Values lists itself ! – are not in access rigths, however they are presents on menu! (I work as Admin, of course)babynus wrote:
Yes, it is a way to disable some item wothout deleting itAs I understand, the ‘idle’ column is requested for use of the table in a combo box, is this true?
Yes : give access rights !1. This new table does not appears in main menu! What have I missed?
But for one country, the id is not the same when langage change…babynus wrote:
idCountry should be added in Client table as int(12) !… don’t build the link with the new table.
Please Connexion or Create an account to join the conversation.
YES THEY ARE : in "access to forms"But some menu entries – as Role and all other entries under Values lists… and Values lists itself ! – are not in access rigths, however they are presents on menu! (I work as Admin, of course)
But for one country, the id is not the same when langage change…
Please Connexion or Create an account to join the conversation.
O.K., found.babynus wrote:
YES THEY ARE : in "access to forms"But some menu entries – as Role and all other entries under Values lists… and Values lists itself ! – are not in access rigths, however they are presents on menu! (I work as Admin, of course)
If you deal with "Access mode to data", only project dependent items are managed here.
there as many lines per country as number of languages used. At now, two :babynus wrote:
But for one country, the id is not the same when langage change…
Please explain, it is not clear.
Please Connexion or Create an account to join the conversation.
Update /css/projectorIcon.cssAnd how add an icone in the menu ?
I have created iconCountry16.png, iconCountry22.png and iconCountry32.png in view/css/images, but noting appears…
You complicated much too much, and will have to code correct list.there as many lines per country as number of languages used. At now, two :
Country code 'de' is for Germany, but with two lines (id, code, lang, name) :
121 de en Germany
122 de fr Allemagne
i.e. country is identified by code, not by line id.
In future, there could be added also, p.e.
487 de de Deutchland
503 de nl Duitsland
733 de es Alemania
999 de gr Γερµανία
etc.
Please Connexion or Create an account to join the conversation.
En poursuivant votre navigation, vous acceptez le dépôt de cookies tiers destinés au bon fonctionnement et à la sécurisation du site (gestion de session, reCaptcha) et à une analyse statistique anonymisée des accès sur notre site (Google Analytics). Si vous vous inscrivez, les informations que vous fournirez ne seront jamais divulguées à un tiers sous quelque forme que ce soit. En savoir plus
Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.
Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.