From 0c7cabbf373650f410dfb6203de7284554484f08 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Mon, 6 Oct 2014 16:15:11 +0300 Subject: [PATCH 01/98] Fix Error when trying to clone an Order --- htdocs/commande/class/commande.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a6659ee8bb3..f6d5677af16 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -898,6 +898,13 @@ class Commande extends CommonOrder $this->date_validation = ''; $this->ref_client = ''; + // Set ref + require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php'; + $obj = $conf->global->COMMANDE_ADDON; + $modCommande = new $obj; + $this->ref = $modCommande->getNextValue($objsoc,$this); + + // Create clone $result=$this->create($user); if ($result < 0) $error++; From e6e953b4d80f37862386eab294b205434d59c5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 14:20:49 +0200 Subject: [PATCH 02/98] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 92 ++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 9081fba5550..f657df7185b 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -459,3 +459,95 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, return $out; } +/** + * On/off button for product tosell or tobuy + * + * @param int $id Id product to set + * @param string $code Name of constant : status or status_buy + * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) + * @param int $entity Entity to set + * @return void + */ +function ajax_productonoff($id, $code, $input=array(), $entity=null) +{ + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + global $conf, $langs, $db; + + $entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity); + $object = new Product($db); + $object->fetch($id); + + $out= ''; + if ($code=='status') { + $out.= ''.img_picto($langs->trans("ProductStatusNotOnSell"),'switch_off').''; + $out.= ''.img_picto($langs->trans("ProductStatusOnSell"),'switch_on').''; + } + if ($code=='status_buy') { + $out.= ''.img_picto($langs->trans("ProductStatusNotOnBuy"),'switch_off').''; + $out.= ''.img_picto($langs->trans("ProductStatusOnBuy"),'switch_on').''; + } + return $out; +} + From 77d77642154d1aeb15f544d58e3407cf9f3040d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 14:22:32 +0200 Subject: [PATCH 03/98] Create productonoff.php --- htdocs/core/ajax/productonoff.php | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 htdocs/core/ajax/productonoff.php diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php new file mode 100644 index 00000000000..4def2898c10 --- /dev/null +++ b/htdocs/core/ajax/productonoff.php @@ -0,0 +1,65 @@ +. + */ + +/** + * \file htdocs/core/ajax/productonoff.php + * \brief File to set tosell and tobuy for product + */ + +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + +$action=GETPOST('action','alpha'); +$name=GETPOST('name','alpha'); +$id=GETPOST('id', 'int'); + +/* + * View + */ + +top_httphead(); + +print ''."\n"; + +// Registering the location of boxes +if (! empty($action) && ! empty($name) &&! empty($id)) +{ + //$entity = GETPOST('entity','int'); + + if ($user->rights->produit->creer) { + if ($action == 'set' && $name== 'status') { + $sql = "UPDATE llx_product SET tosell=1 WHERE rowid=".$id; + $resql = $db->query($sql); + } else if ($action == 'set' && $name== 'status_buy') { + $sql = "UPDATE llx_product SET tobuy=1 WHERE rowid=".$id; + $resql = $db->query($sql); + } else if ($action == 'del' && $name== 'status') { + $sql = "UPDATE llx_product SET tosell=0 WHERE rowid=".$id; + $resql = $db->query($sql); + } else if ($action == 'del' && $name== 'status_buy') { + $sql = "UPDATE llx_product SET tobuy=0 WHERE rowid=".$id; + $resql = $db->query($sql); + } + + } +} From 633f01e5a2e1c8b3ca2f6bd5af04d249a57edb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 14:26:51 +0200 Subject: [PATCH 04/98] Update card.php --- htdocs/product/card.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index a9f533ba40b..0f374dc2b3a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1420,12 +1420,20 @@ else // Status (to sell) print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - print $object->getLibStatut(2,0); + if (! empty($conf->use_javascript_ajax)) { + print ajax_productonoff($object->id, 'status'); + } else { + print $object->getLibStatut(2,0); + } print ''; // Status (to buy) print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $object->getLibStatut(2,1); + if (! empty($conf->use_javascript_ajax)) { + print ajax_productonoff($object->id, 'status_buy'); + } else { + print $object->getLibStatut(2,1); + } print ''; // Batch number management (to batch) From cbbe909bc58f028ab3a76156171d2ff8202ca8a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 15:22:07 +0200 Subject: [PATCH 05/98] Fix: Pb in management of "or" ("|") for permission check. --- htdocs/compta/charges/index.php | 10 +++++----- htdocs/core/lib/security.lib.php | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f38f7e72aa2..a3803e853ba 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -111,7 +111,7 @@ if ($conf->salaries->enabled) $total = 0 ; print ''; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.datev","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.datev","",$param,'width="140px"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); @@ -144,7 +144,7 @@ if ($conf->salaries->enabled) $i++; } - print ''; + print ''; print '"; print ''; print ''; @@ -174,7 +174,7 @@ if ($conf->tax->enabled) print '
'.$langs->trans("Total").'
'.$langs->trans("Total").''.price($total)."  
'; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); @@ -304,7 +304,7 @@ if ($conf->tax->enabled) $total = 0 ; print '
'; print ''; - print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); @@ -337,7 +337,7 @@ if ($conf->tax->enabled) $i++; } - print ''; + print ''; print '"; print ''; print ''; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 31e900f8e7e..7416d564a1a 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -174,11 +174,17 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature } else if (! empty($feature2)) // This should be used for future changes { + $tmpreadok=1; foreach($feature2 as $subfeature) { - if (! empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $readok=0; $nbko++; } - else if (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $readok=0; $nbko++; } - else { $readok=1; break; } // Break is to bypass second test if the first is ok + if (! empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $tmpreadok=0; } + else if (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $tmpreadok=0; } + else { $tmpreadok=1; break; } // Break is to bypass second test if the first is ok + } + if (! $tmpreadok) // We found a test on feature that is ko + { + $readok=0; // All tests are ko (we manage here the and, the or will be managed later using $nbko). + $nbko++; } } else if (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions From 71dafac03ce6fa79366a9f04d0b7f6b3c7add23c Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 12 Oct 2014 15:28:01 +0200 Subject: [PATCH 06/98] Add favorite button into country dictionary to put value on top select list --- ChangeLog | 10 +- htdocs/admin/dict.php | 61 ++- htdocs/core/class/html.form.class.php | 9 +- .../install/mysql/data/llx_00_c_country.sql | 489 +++++++++--------- .../install/mysql/migration/3.6.0-3.7.0.sql | 3 + htdocs/install/mysql/tables/llx_c_country.sql | 8 +- htdocs/langs/en_US/main.lang | 1 + 7 files changed, 323 insertions(+), 258 deletions(-) diff --git a/ChangeLog b/ChangeLog index d531ec987b3..3a6f5c34eda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,9 +60,12 @@ For users: - New: Add option MAIN_GENERATE_INVOICES_WITH_PICTURE to show picture onto PDF like MAIN_GENERATE_PROPOSALS_WITH_PICTURE dir for proposals. - New: Add more search field in list of cheque deposits. -- New: Add feature to order to invoice on supplier part +- New: Add feature to order to invoice on supplier part. +- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export. +- New: Direct invoice creation from predefined invoice. +- New: Add dunning into accountancy report. +- New: Add favorite button into country dictionary to put value on top select list - Upgrade phpexcel lib to 1.7.8 -- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem @@ -80,8 +83,7 @@ For users: - Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. -- New: Direct invoice creation from predefined invoice -- New: Add dunning into accountancy report + For users, new experimental module: - New: Module Accounting Expert to manage accountancy Special Thanks to developpers : diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7a84470b320..335716bc4c7 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -131,7 +131,7 @@ $tabsql=array(); $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid"; $tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1"; $tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1"; -$tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country"; +$tabsql[4] = "SELECT rowid as rowid, code, label, active, favorite FROM ".MAIN_DB_PREFIX."c_country"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; $tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1"; @@ -677,6 +677,46 @@ if ($action == $acts[1]) } } +// favorite +if ($action == $acts[0]) +{ + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + if ($rowid) { + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'"; + } + elseif ($_GET["code"]) { + $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".$_GET["code"]."'"; + } + + $result = $db->query($sql); + if (!$result) + { + dol_print_error($db); + } +} + +// disable favorite +if ($action == $acts[1]) +{ + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + if ($rowid) { + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'"; + } + elseif ($_GET["code"]) { + $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".$_GET["code"]."'"; + } + + $result = $db->query($sql); + if (!$result) + { + dol_print_error($db); + } +} + /* * View @@ -813,7 +853,7 @@ if ($id) } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; } - print ''; print ''; @@ -928,8 +968,11 @@ if ($id) print getTitleFieldOfList($valuetoshow,0,$_SERVER["PHP_SELF"],($sortable?$fieldlist[$field]:''),($page?'page='.$page.'&':'').'&id='.$id,"","align=".$align,$sortfield,$sortorder); } } - print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"active",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); - print ''; + // Favorite - Only activated on country dictionary + if ($id == 4) print getTitleFieldOfList($langs->trans("Favorite"),0,$_SERVER["PHP_SELF"],"favorite",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); + + print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"active",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); + print ''; print ''; // Lines with values @@ -1141,6 +1184,16 @@ if ($id) if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; } $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&'; + + // Favorite + // Only activated on country dictionary + if ($id == 4) + { + print ''; + } // Active print '' . "\n"; } diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 89edfcbae8e..d5f8ea7c18c 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -141,7 +141,7 @@ if ($action == 'add') } } - $result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params); + $result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$default_value,$params,(GETPOST('alwayseditable')?1:0)); if ($result > 0) { setEventMessage($langs->trans('SetupSaved')); @@ -278,7 +278,7 @@ if ($action == 'update') $params['options'][$key] = $value; } } - $result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$pos,$params); + $result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0),(GETPOST('required')?1:0),$pos,$params,(GETPOST('alwayseditable')?1:0)); if ($result > 0) { setEventMessage($langs->trans('SetupSaved')); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 42c505a54bf..9075cac94e3 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -50,6 +50,8 @@ class ExtraFields var $attribute_param; // Int to store position of attribute var $attribute_pos; + // Int to store if attribute is editable regardless of the document status + var $attribute_alwayseditable; var $error; var $errno; @@ -105,7 +107,7 @@ class ExtraFields * @param array $param Params for field * @return int <=0 if KO, >0 if OK */ - function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0,$default_value='', $param=0) + function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0) { if (empty($attrname)) return -1; if (empty($label)) return -1; @@ -119,7 +121,7 @@ class ExtraFields if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') { // Add declaration of field into table - $result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param); + $result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param, $alwayseditable); $err2=$this->errno; if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { @@ -219,7 +221,7 @@ class ExtraFields * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @return int <=0 if KO, >0 if OK */ - private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='') + private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0) { global $conf; @@ -241,7 +243,7 @@ class ExtraFields $params=''; } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(name, label, type, pos, size, entity, elementtype, fieldunique, fieldrequired, param, alwayseditable)"; $sql.= " VALUES('".$attrname."',"; $sql.= " '".$this->db->escape($label)."',"; $sql.= " '".$type."',"; @@ -251,7 +253,8 @@ class ExtraFields $sql.= " '".$elementtype."',"; $sql.= " '".$unique."',"; $sql.= " '".$required."',"; - $sql.= " '".$params."'"; + $sql.= " '".$params."',"; + $sql.= " '".$alwayseditable."'"; $sql.=')'; dol_syslog(get_class($this)."::create_label", LOG_DEBUG); @@ -349,7 +352,7 @@ class ExtraFields * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @return int >0 if OK, <=0 if KO */ - function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='') + function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0) { $table=$elementtype.'_extrafields'; @@ -384,7 +387,7 @@ class ExtraFields { if ($label) { - $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param); + $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable); } if ($result > 0) { @@ -434,7 +437,7 @@ class ExtraFields * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='') + private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0) { global $conf; dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required); @@ -465,6 +468,7 @@ class ExtraFields $sql.= " fieldunique,"; $sql.= " fieldrequired,"; $sql.= " pos,"; + $sql.= " alwayseditable,"; $sql.= " param"; $sql.= ") VALUES ("; $sql.= "'".$attrname."',"; @@ -476,6 +480,7 @@ class ExtraFields $sql.= " '".$unique."',"; $sql.= " '".$required."',"; $sql.= " '".$pos."',"; + $sql.= " '".$alwayseditable."',"; $sql.= " '".$param."'"; $sql.= ")"; dol_syslog(get_class($this)."::update_label", LOG_DEBUG); @@ -529,7 +534,7 @@ class ExtraFields if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label; - $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos"; + $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " WHERE entity IN (0,".$conf->entity.")"; if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; @@ -557,6 +562,7 @@ class ExtraFields $this->attribute_required[$tab->name]=$tab->fieldrequired; $this->attribute_param[$tab->name]=unserialize($tab->param); $this->attribute_pos[$tab->name]=$tab->pos; + $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; } } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index e4c4d75c85e..bdced511867 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -101,6 +101,8 @@ + +
'.$langs->trans("Total").'
'.$langs->trans("Total").''.price($total)."  '; + print ''; print ''; print ' 
  
'; + if ($iserasable) print ''.$actl[$obj->favorite].''; + else print $langs->trans("AlwaysActive"); + print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d4effca3905..9460477439b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Raphaël Doursenaud + * Copyright (C) 2014 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -477,9 +478,10 @@ class Form $out=''; $countryArray=array(); + $favorite=array(); $label=array(); - $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label"; + $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country"; $sql.= " WHERE active = 1"; //$sql.= " ORDER BY code ASC"; @@ -502,11 +504,12 @@ class Form $countryArray[$i]['code_iso'] = $obj->code_iso; $countryArray[$i]['code_iso3'] = $obj->code_iso3; $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:'')); - $label[$i] = dol_string_unaccent($countryArray[$i]['label']); + $favorite[$i] = $obj->favorite; + $label[$i] = dol_string_unaccent($countryArray[$i]['label']); $i++; } - array_multisort($label, SORT_ASC, $countryArray); + array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray); foreach ($countryArray as $row) { diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 497b85d4059..a6c0efc77a6 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -5,6 +5,7 @@ -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin -- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2014 Alexandre Spangaro -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -26,247 +27,247 @@ -- -- delete from llx_c_country; -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (0,'',NULL,'-',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (1,'FR','FRA','France',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (2,'BE','BEL','Belgium',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (3,'IT','ITA','Italy',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (4,'ES','ESP','Spain',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (5,'DE','DEU','Germany',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (6,'CH','CHE','Switzerland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (7,'GB','GBR','United Kingdom',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (8,'IE','IRL','Irland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (9,'CN','CHN','China',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (10,'TN','TUN','Tunisia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (11,'US','USA','United States',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (12,'MA','MAR','Maroc',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (13,'DZ','DZA','Algeria',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (14,'CA','CAN','Canada',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (15,'TG','TGO','Togo',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (16,'GA','GAB','Gabon',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (17,'NL','NLD','Nerderland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (18,'HU','HUN','Hongrie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (19,'RU','RUS','Russia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (20,'SE','SWE','Sweden',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (22,'SN','SEN','Senegal',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (23,'AR','ARG','Argentine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (24,'CM','CMR','Cameroun',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (25,'PT','PRT','Portugal',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (26,'SA','SAU','Saudi Arabia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (27,'MC','MCO','Monaco',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (28,'AU','AUS','Australia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (29,'SG','SGP','Singapour',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (30,'AF','AFG','Afghanistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (31,'AX','ALA','Iles Aland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (32,'AL','ALB','Albanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (33,'AS','ASM','Samoa américaines',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (34,'AD','AND','Andorre',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (35,'AO','AGO','Angola',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (36,'AI','AIA','Anguilla',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (37,'AQ','ATA','Antarctique',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (39,'AM','ARM','Arménie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (40,'AW','ABW','Aruba',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (41,'AT','AUT','Autriche',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (43,'BS','BHS','Bahamas',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (44,'BH','BHR','Bahreïn',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (45,'BD','BGD','Bangladesh',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (46,'BB','BRB','Barbade',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (47,'BY','BLR','Biélorussie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (48,'BZ','BLZ','Belize',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (49,'BJ','BEN','Bénin',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (50,'BM','BMU','Bermudes',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (51,'BT','BTN','Bhoutan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (52,'BO','BOL','Bolivie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (54,'BW','BWA','Botswana',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (55,'BV','BVT','Ile Bouvet',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (56,'BR','BRA','Brazil',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (58,'BN','BRN','Brunei',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (59,'BG','BGR','Bulgarie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (60,'BF','BFA','Burkina Faso',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (61,'BI','BDI','Burundi',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (62,'KH','KHM','Cambodge',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (63,'CV','CPV','Cap-Vert',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (64,'KY','CYM','Iles Cayman',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (65,'CF','CAF','République centrafricaine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (66,'TD','TCD','Tchad',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (67,'CL','CHL','Chili',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (68,'CX','CXR','Ile Christmas',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (70,'CO','COL','Colombie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (71,'KM','COM','Comores',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (72,'CG','COG','Congo',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (73,'CD','COD','République démocratique du Congo',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (74,'CK','COK','Iles Cook',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (75,'CR','CRI','Costa Rica',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (76,'HR','HRV','Croatie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (77,'CU','CUB','Cuba',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (78,'CY','CYP','Chypre',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (79,'CZ','CZE','République Tchèque',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (80,'DK','DNK','Danemark',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (81,'DJ','DJI','Djibouti',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (82,'DM','DMA','Dominique',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (83,'DO','DOM','République Dominicaine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (84,'EC','ECU','Equateur',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (85,'EG','EGY','Egypte',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (86,'SV','SLV','Salvador',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (88,'ER','ERI','Erythrée',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (89,'EE','EST','Estonia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (90,'ET','ETH','Ethiopie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (91,'FK','FLK','Iles Falkland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (92,'FO','FRO','Iles Féroé',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (93,'FJ','FJI','Iles Fidji',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (94,'FI','FIN','Finlande',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (95,'GF','GUF','Guyane française',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (96,'PF','PYF','Polynésie française',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (97,'TF','ATF','Terres australes françaises',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (98,'GM','GMB','Gambie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (99,'GE','GEO','Georgia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (100,'GH','GHA','Ghana',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (101,'GI','GIB','Gibraltar',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (102,'GR','GRC','Greece',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (103,'GL','GRL','Groenland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (104,'GD','GRD','Grenade',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (106,'GU','GUM','Guam',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (107,'GT','GTM','Guatemala',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (108,'GN','GIN','Guinea',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (109,'GW','GNB','Guinea-Bissao',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (111,'HT','HTI','Haiti',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (114,'HN','HND','Honduras',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (115,'HK','HKG','Hong Kong',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (116,'IS','ISL','Islande',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (117,'IN','IND','India',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (118,'ID','IDN','Indonésie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (119,'IR','IRN','Iran',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (120,'IQ','IRQ','Iraq',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (121,'IL','ISR','Israel',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (122,'JM','JAM','Jamaïque',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (123,'JP','JPN','Japon',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (124,'JO','JOR','Jordanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (125,'KZ','KAZ','Kazakhstan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (126,'KE','KEN','Kenya',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (127,'KI','KIR','Kiribati',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (128,'KP','PRK','North Corea',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (129,'KR','KOR','South Corea',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (130,'KW','KWT','Koweït',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (131,'KG','KGZ','Kirghizistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (132,'LA','LAO','Laos',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (133,'LV','LVA','Lettonie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (134,'LB','LBN','Liban',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (135,'LS','LSO','Lesotho',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (136,'LR','LBR','Liberia',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (137,'LY','LBY','Libye',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (138,'LI','LIE','Liechtenstein',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (139,'LT','LTU','Lituanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (140,'LU','LUX','Luxembourg',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (141,'MO','MAC','Macao',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (143,'MG','MDG','Madagascar',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (144,'MW','MWI','Malawi',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (145,'MY','MYS','Malaisie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (146,'MV','MDV','Maldives',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (147,'ML','MLI','Mali',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (148,'MT','MLT','Malte',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (149,'MH','MHL','Iles Marshall',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (151,'MR','MRT','Mauritanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (152,'MU','MUS','Maurice',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (153,'YT','MYT','Mayotte',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (154,'MX','MEX','Mexique',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (155,'FM','FSM','Micronésie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (156,'MD','MDA','Moldavie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (157,'MN','MNG','Mongolie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (158,'MS','MSR','Monserrat',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (159,'MZ','MOZ','Mozambique',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (161,'NA','NAM','Namibie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (162,'NR','NRU','Nauru',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (163,'NP','NPL','Népal',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (167,'NI','NIC','Nicaragua',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (168,'NE','NER','Niger',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (169,'NG','NGA','Nigeria',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (170,'NU','NIU','Nioué',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (171,'NF','NFK','Ile Norfolk',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (172,'MP','MNP','Mariannes du Nord',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (173,'NO','NOR','Norvège',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (174,'OM','OMN','Oman',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (175,'PK','PAK','Pakistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (176,'PW','PLW','Palaos',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (178,'PA','PAN','Panama',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (180,'PY','PRY','Paraguay',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (181,'PE','PER','Peru',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (182,'PH','PHL','Philippines',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (183,'PN','PCN','Iles Pitcairn',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (184,'PL','POL','Pologne',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (185,'PR','PRI','Porto Rico',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (186,'QA','QAT','Qatar',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (188,'RO','ROU','Roumanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (189,'RW','RWA','Rwanda',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (190,'SH','SHN','Sainte-Hélène',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (192,'LC','LCA','Sainte-Lucie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (195,'WS','WSM','Samoa',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (196,'SM','SMR','Saint-Marin',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (198,'RS','SRB','Serbie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (199,'SC','SYC','Seychelles',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (200,'SL','SLE','Sierra Leone',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (201,'SK','SVK','Slovaquie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (202,'SI','SVN','Slovénie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (203,'SB','SLB','Iles Salomon',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (204,'SO','SOM','Somalie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (207,'LK','LKA','Sri Lanka',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (208,'SD','SDN','Soudan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (209,'SR','SUR','Suriname',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (211,'SZ','SWZ','Swaziland',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (212,'SY','SYR','Syrie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (213,'TW','TWN','Taïwan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (214,'TJ','TJK','Tadjikistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (215,'TZ','TZA','Tanzanie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (216,'TH','THA','Thaïlande',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (217,'TL','TLS','Timor Oriental',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (218,'TK','TKL','Tokélaou',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (219,'TO','TON','Tonga',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (221,'TR','TUR','Turquie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (222,'TM','TKM','Turkménistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (224,'TV','TUV','Tuvalu',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (225,'UG','UGA','Ouganda',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (226,'UA','UKR','Ukraine',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (227,'AE','ARE','Émirats arabes unis',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (229,'UY','URY','Uruguay',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (230,'UZ','UZB','Ouzbékistan',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (231,'VU','VUT','Vanuatu',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (232,'VE','VEN','Vénézuela',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (233,'VN','VNM','Viêt Nam',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (237,'EH','ESH','Sahara occidental',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (238,'YE','YEM','Yémen',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (239,'ZM','ZMB','Zambie',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (240,'ZW','ZWE','Zimbabwe',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (241,'GG','GGY','Guernesey',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (242,'IM','IMN','Ile de Man',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (243,'JE','JEY','Jersey',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (244,'ME','MNE','Monténégro',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (246,'MF','MAF','Saint-Martin',1); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (247,'BU', null, 'Burundi',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (0,'',NULL,'-',1,1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (1,'FR','FRA','France',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (2,'BE','BEL','Belgium',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (3,'IT','ITA','Italy',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (4,'ES','ESP','Spain',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (5,'DE','DEU','Germany',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (6,'CH','CHE','Switzerland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (7,'GB','GBR','United Kingdom',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (8,'IE','IRL','Irland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (9,'CN','CHN','China',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (10,'TN','TUN','Tunisia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (11,'US','USA','United States',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (12,'MA','MAR','Maroc',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (13,'DZ','DZA','Algeria',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (14,'CA','CAN','Canada',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (15,'TG','TGO','Togo',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (16,'GA','GAB','Gabon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (17,'NL','NLD','Nerderland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (18,'HU','HUN','Hongrie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (19,'RU','RUS','Russia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (20,'SE','SWE','Sweden',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (21,'CI','CIV','Côte d''Ivoire',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (22,'SN','SEN','Senegal',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (23,'AR','ARG','Argentine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24,'CM','CMR','Cameroun',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (25,'PT','PRT','Portugal',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (26,'SA','SAU','Saudi Arabia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (27,'MC','MCO','Monaco',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (28,'AU','AUS','Australia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (29,'SG','SGP','Singapour',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (30,'AF','AFG','Afghanistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (31,'AX','ALA','Iles Aland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (32,'AL','ALB','Albanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (33,'AS','ASM','Samoa américaines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (34,'AD','AND','Andorre',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (35,'AO','AGO','Angola',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (36,'AI','AIA','Anguilla',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (37,'AQ','ATA','Antarctique',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (39,'AM','ARM','Arménie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (40,'AW','ABW','Aruba',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (41,'AT','AUT','Autriche',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (42,'AZ','AZE','Azerbaïdjan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (43,'BS','BHS','Bahamas',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (44,'BH','BHR','Bahreïn',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (45,'BD','BGD','Bangladesh',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (46,'BB','BRB','Barbade',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (47,'BY','BLR','Biélorussie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (48,'BZ','BLZ','Belize',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (49,'BJ','BEN','Bénin',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (50,'BM','BMU','Bermudes',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (51,'BT','BTN','Bhoutan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (52,'BO','BOL','Bolivie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (54,'BW','BWA','Botswana',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (55,'BV','BVT','Ile Bouvet',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (56,'BR','BRA','Brazil',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (58,'BN','BRN','Brunei',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (59,'BG','BGR','Bulgarie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (60,'BF','BFA','Burkina Faso',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (61,'BI','BDI','Burundi',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (62,'KH','KHM','Cambodge',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (63,'CV','CPV','Cap-Vert',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (64,'KY','CYM','Iles Cayman',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (65,'CF','CAF','République centrafricaine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (66,'TD','TCD','Tchad',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (67,'CL','CHL','Chili',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (68,'CX','CXR','Ile Christmas',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (70,'CO','COL','Colombie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (71,'KM','COM','Comores',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (72,'CG','COG','Congo',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (73,'CD','COD','République démocratique du Congo',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (74,'CK','COK','Iles Cook',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (75,'CR','CRI','Costa Rica',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (76,'HR','HRV','Croatie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (77,'CU','CUB','Cuba',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (78,'CY','CYP','Chypre',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','République Tchèque',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Danemark',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (81,'DJ','DJI','Djibouti',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominique',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','République Dominicaine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Equateur',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypte',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','Salvador',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Iles Falkland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (92,'FO','FRO','Iles Féroé',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (93,'FJ','FJI','Iles Fidji',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (94,'FI','FIN','Finlande',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (95,'GF','GUF','Guyane française',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (96,'PF','PYF','Polynésie française',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (97,'TF','ATF','Terres australes françaises',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (98,'GM','GMB','Gambie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (99,'GE','GEO','Georgia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (100,'GH','GHA','Ghana',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (101,'GI','GIB','Gibraltar',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (102,'GR','GRC','Greece',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (103,'GL','GRL','Groenland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (104,'GD','GRD','Grenade',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (106,'GU','GUM','Guam',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (107,'GT','GTM','Guatemala',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (108,'GN','GIN','Guinea',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (109,'GW','GNB','Guinea-Bissao',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (111,'HT','HTI','Haiti',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (112,'HM','HMD','Iles Heard et McDonald',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (114,'HN','HND','Honduras',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (115,'HK','HKG','Hong Kong',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (116,'IS','ISL','Islande',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (117,'IN','IND','India',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (118,'ID','IDN','Indonésie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (119,'IR','IRN','Iran',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (120,'IQ','IRQ','Iraq',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (121,'IL','ISR','Israel',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (122,'JM','JAM','Jamaïque',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (123,'JP','JPN','Japon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (124,'JO','JOR','Jordanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (125,'KZ','KAZ','Kazakhstan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (126,'KE','KEN','Kenya',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (127,'KI','KIR','Kiribati',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (128,'KP','PRK','North Corea',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (129,'KR','KOR','South Corea',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (130,'KW','KWT','Koweït',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (131,'KG','KGZ','Kirghizistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (132,'LA','LAO','Laos',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (133,'LV','LVA','Lettonie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (134,'LB','LBN','Liban',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (135,'LS','LSO','Lesotho',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (136,'LR','LBR','Liberia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (137,'LY','LBY','Libye',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (138,'LI','LIE','Liechtenstein',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (139,'LT','LTU','Lituanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (140,'LU','LUX','Luxembourg',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (141,'MO','MAC','Macao',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (143,'MG','MDG','Madagascar',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (144,'MW','MWI','Malawi',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (145,'MY','MYS','Malaisie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (146,'MV','MDV','Maldives',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (147,'ML','MLI','Mali',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (148,'MT','MLT','Malte',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (149,'MH','MHL','Iles Marshall',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (151,'MR','MRT','Mauritanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (152,'MU','MUS','Maurice',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (153,'YT','MYT','Mayotte',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (154,'MX','MEX','Mexique',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (155,'FM','FSM','Micronésie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (156,'MD','MDA','Moldavie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (157,'MN','MNG','Mongolie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (158,'MS','MSR','Monserrat',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (159,'MZ','MOZ','Mozambique',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (161,'NA','NAM','Namibie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (162,'NR','NRU','Nauru',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (163,'NP','NPL','Népal',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (164,'AN',NULL,'Antilles néerlandaises',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (167,'NI','NIC','Nicaragua',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (168,'NE','NER','Niger',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (169,'NG','NGA','Nigeria',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Nioué',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Ile Norfolk',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Mariannes du Nord',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norvège',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (174,'OM','OMN','Oman',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (175,'PK','PAK','Pakistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palaos',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (178,'PA','PAN','Panama',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (180,'PY','PRY','Paraguay',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (181,'PE','PER','Peru',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (182,'PH','PHL','Philippines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Iles Pitcairn',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Porto Rico',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Sainte-Hélène',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Sainte-Lucie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (195,'WS','WSM','Samoa',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','Saint-Marin',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (199,'SC','SYC','Seychelles',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (200,'SL','SLE','Sierra Leone',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovaquie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovénie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Iles Salomon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (205,'ZA','ZAF','Afrique du Sud',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (207,'LK','LKA','Sri Lanka',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (208,'SD','SDN','Soudan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (209,'SR','SUR','Suriname',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (211,'SZ','SWZ','Swaziland',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (212,'SY','SYR','Syrie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (213,'TW','TWN','Taïwan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (214,'TJ','TJK','Tadjikistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (215,'TZ','TZA','Tanzanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (216,'TH','THA','Thaïlande',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (217,'TL','TLS','Timor Oriental',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (218,'TK','TKL','Tokélaou',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (219,'TO','TON','Tonga',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (220,'TT','TTO','Trinité-et-Tobago',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (221,'TR','TUR','Turquie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (222,'TM','TKM','Turkménistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (224,'TV','TUV','Tuvalu',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (225,'UG','UGA','Ouganda',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (226,'UA','UKR','Ukraine',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (227,'AE','ARE','Émirats arabes unis',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (229,'UY','URY','Uruguay',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (230,'UZ','UZB','Ouzbékistan',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (231,'VU','VUT','Vanuatu',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (232,'VE','VEN','Vénézuela',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (233,'VN','VNM','Viêt Nam',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (234,'VG','VGB','Iles Vierges britanniques',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (235,'VI','VIR','Iles Vierges américaines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (236,'WF','WLF','Wallis-et-Futuna',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (237,'EH','ESH','Sahara occidental',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (238,'YE','YEM','Yémen',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (239,'ZM','ZMB','Zambie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (240,'ZW','ZWE','Zimbabwe',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (241,'GG','GGY','Guernesey',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (242,'IM','IMN','Ile de Man',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (243,'JE','JEY','Jersey',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (244,'ME','MNE','Monténégro',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (245,'BL','BLM','Saint-Barthélemy',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (246,'MF','MAF','Saint-Martin',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (247,'BU', null, 'Burundi',1,0); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 9f4291cd05f..6d6dea17da7 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1086,3 +1086,6 @@ CREATE TABLE llx_usergroup_extrafields ( ALTER TABLE llx_usergroup_extrafields ADD INDEX idx_usergroup_extrafields (fk_object); ALTER TABLE llx_contrat ADD COLUMN model_pdf varchar(255) DEFAULT NULL AFTER note_public; + +ALTER TABLE llx_c_country ADD COLUMN favorite tinyint DEFAULT 0 AFTER active; +UPDATE llx_c_country SET favorite = '1' WHERE rowid = '0'; diff --git a/htdocs/install/mysql/tables/llx_c_country.sql b/htdocs/install/mysql/tables/llx_c_country.sql index f9c69a5093b..503cc0eec06 100644 --- a/htdocs/install/mysql/tables/llx_c_country.sql +++ b/htdocs/install/mysql/tables/llx_c_country.sql @@ -1,6 +1,7 @@ -- ======================================================================== --- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2014 Alexandre Spangaro -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -23,5 +24,6 @@ create table llx_c_country code varchar(2) NOT NULL, code_iso varchar(3) , label varchar(50) NOT NULL, - active tinyint DEFAULT 1 NOT NULL + active tinyint DEFAULT 1 NOT NULL, + favorite tinyint DEFAULT 0 NOT NULL )ENGINE=innodb; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7663f520667..89e6672f4fe 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -341,6 +341,7 @@ FullList=Full list Statistics=Statistics OtherStatistics=Other statistics Status=Status +Favorite=Favorite ShortInfo=Info. Ref=Ref. RefSupplier=Ref. supplier From 30e27014b887b21dfb33458512b8819bdcac3e6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 15:49:14 +0200 Subject: [PATCH 07/98] Fix: box of customer and propsects were not correctly disabled. --- htdocs/core/boxes/box_clients.php | 18 +++++++++++++++++- htdocs/core/boxes/box_prospect.php | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index b2ad0a6b718..b65702b643f 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -37,12 +37,28 @@ class box_clients extends ModeleBoxes var $depends = array("societe"); var $db; - var $param; + var $enabled = 1; var $info_box_head = array(); var $info_box_contents = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param='') + { + global $conf, $user; + + $this->db = $db; + + // disable box for such cases + if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option + } + /** * Load data for box to show them later * diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 9c7a666bc4a..6d62989727b 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -39,11 +39,28 @@ class box_prospect extends ModeleBoxes var $depends = array("societe"); var $db; + var $enabled = 1; var $info_box_head = array(); var $info_box_contents = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param='') + { + global $conf, $user; + + $this->db = $db; + + // disable box for such cases + if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option + } + /** * Load data into info_box_contents array to show array later. * From 455bae98ef41d67d402ad0e8f03183ccba4817c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 15:49:29 +0200 Subject: [PATCH 08/98] Fix: box of customer and propsects were not correctly disabled. --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 12694302fda..42a8d6d6b28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ English Dolibarr ChangeLog - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice - Fix: bug 1588 : relative discount - Fix: label of input method not tranlated. +- Fix: box of customer and propsects were not correctly disabled. ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: From f25c4f18e693fe31d75fa7430db15b03a8c538b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 15:55:18 +0200 Subject: [PATCH 09/98] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f657df7185b..4a43c06ad36 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -468,12 +468,11 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, * @param int $entity Entity to set * @return void */ -function ajax_productonoff($id, $code, $input=array(), $entity=null) +function ajax_productonoff($id, $code, $input=array()) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; global $conf, $langs, $db; - $entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity); $object = new Product($db); $object->fetch($id); @@ -484,10 +483,9 @@ function ajax_productonoff($id, $code, $input=array(), $entity=null) // Set constant $("#set_'.$code.'").click(function() { $.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", { - action: \'set\', - name: \''.$code.'\', - id: \''.$id.'\', - entity: \''.$entity.'\' + action: \'set'.$code.'\', + value: \'1\', + id: \''.$id.'\' }, function() { $("#set_'.$code.'").hide(); @@ -513,10 +511,9 @@ function ajax_productonoff($id, $code, $input=array(), $entity=null) // Del constant $("#del_'.$code.'").click(function() { $.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", { - action: \'del\', - name: \''.$code.'\', - id: \''.$id.'\', - entity: \''.$entity.'\' + action: \'set'.$code.'\', + value: \'0\', + id: \''.$id.'\' }, function() { $("#del_'.$code.'").hide(); From 052e507271961c87b32b10d1197125b58f3db4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 15:56:04 +0200 Subject: [PATCH 10/98] Update productonoff.php --- htdocs/core/ajax/productonoff.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php index 4def2898c10..227a9ef9001 100644 --- a/htdocs/core/ajax/productonoff.php +++ b/htdocs/core/ajax/productonoff.php @@ -27,12 +27,14 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; $action=GETPOST('action','alpha'); $name=GETPOST('name','alpha'); $id=GETPOST('id', 'int'); +$value=GETPOST('value', 'int'); +$object = new GenericObject($db); /* * View */ @@ -42,24 +44,15 @@ top_httphead(); print ''."\n"; // Registering the location of boxes -if (! empty($action) && ! empty($name) &&! empty($id)) +if (! empty($action) && ! empty($id)) { //$entity = GETPOST('entity','int'); if ($user->rights->produit->creer) { - if ($action == 'set' && $name== 'status') { - $sql = "UPDATE llx_product SET tosell=1 WHERE rowid=".$id; - $resql = $db->query($sql); - } else if ($action == 'set' && $name== 'status_buy') { - $sql = "UPDATE llx_product SET tobuy=1 WHERE rowid=".$id; - $resql = $db->query($sql); - } else if ($action == 'del' && $name== 'status') { - $sql = "UPDATE llx_product SET tosell=0 WHERE rowid=".$id; - $resql = $db->query($sql); - } else if ($action == 'del' && $name== 'status_buy') { - $sql = "UPDATE llx_product SET tobuy=0 WHERE rowid=".$id; - $resql = $db->query($sql); - } + if ($action == 'setstatus') + $object->setValueFrom('tosell', $value, 'product', $id); + else if ($action == 'setstatus_buy') + $object->setValueFrom('tobuy', $value, 'product', $id); } } From f5f50045d6c63b01b1e3cc23901df7eda3cb7f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 16:09:42 +0200 Subject: [PATCH 11/98] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4a43c06ad36..4bc6da083aa 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -465,7 +465,6 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, * @param int $id Id product to set * @param string $code Name of constant : status or status_buy * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) - * @param int $entity Entity to set * @return void */ function ajax_productonoff($id, $code, $input=array()) From 33bb150b440af67c70f5b10bd29e70d9ef25f127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 16:30:58 +0200 Subject: [PATCH 12/98] Update productonoff.php --- htdocs/core/ajax/productonoff.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php index 227a9ef9001..a6c63507f21 100644 --- a/htdocs/core/ajax/productonoff.php +++ b/htdocs/core/ajax/productonoff.php @@ -35,6 +35,7 @@ $id=GETPOST('id', 'int'); $value=GETPOST('value', 'int'); $object = new GenericObject($db); + /* * View */ @@ -43,16 +44,10 @@ top_httphead(); print ''."\n"; -// Registering the location of boxes -if (! empty($action) && ! empty($id)) -{ - //$entity = GETPOST('entity','int'); - - if ($user->rights->produit->creer) { - if ($action == 'setstatus') - $object->setValueFrom('tosell', $value, 'product', $id); - else if ($action == 'setstatus_buy') - $object->setValueFrom('tobuy', $value, 'product', $id); - - } +// Registering new values +if (! empty($action) && ! empty($id) && $user->rights->produit->creer) { + if ($action == 'setstatus') + $object->setValueFrom('tosell', $value, 'product', $id); + else if ($action == 'setstatus_buy') + $object->setValueFrom('tobuy', $value, 'product', $id); } From 7f308bf9b5af2a7dca78a1bc626b7148d4934317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 17:00:42 +0200 Subject: [PATCH 13/98] Update productonoff.php --- htdocs/core/ajax/productonoff.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/ajax/productonoff.php b/htdocs/core/ajax/productonoff.php index a6c63507f21..05eebc7a65f 100644 --- a/htdocs/core/ajax/productonoff.php +++ b/htdocs/core/ajax/productonoff.php @@ -30,7 +30,6 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; $action=GETPOST('action','alpha'); -$name=GETPOST('name','alpha'); $id=GETPOST('id', 'int'); $value=GETPOST('value', 'int'); From 99dde1ad1e1c8c81842874978f7895fe230ae833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Oct 2014 20:44:50 +0200 Subject: [PATCH 14/98] Update card.php --- htdocs/product/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0f374dc2b3a..5644e41df1c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1420,7 +1420,7 @@ else // Status (to sell) print '
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - if (! empty($conf->use_javascript_ajax)) { + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_productonoff($object->id, 'status'); } else { print $object->getLibStatut(2,0); @@ -1429,7 +1429,7 @@ else // Status (to buy) print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - if (! empty($conf->use_javascript_ajax)) { + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { print ajax_productonoff($object->id, 'status_buy'); } else { print $object->getLibStatut(2,1); From 452636b0e41ac0f6ffd9cb19aa1e16504d65bdcf Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 14 Oct 2014 15:27:40 +0200 Subject: [PATCH 15/98] New : Add option to allow extrafield to be modified regardless of the document status --- htdocs/comm/propal.php | 13 ++++++---- htdocs/core/actions_extrafields.inc.php | 4 ++-- htdocs/core/class/extrafields.class.php | 24 ++++++++++++------- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 ++ .../core/tpl/admin_extrafields_edit.tpl.php | 3 +++ .../install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ .../install/mysql/tables/llx_extrafields.sql | 3 ++- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index b344da39112..1f211c3cb79 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2032,9 +2032,16 @@ if ($action == 'create') } else { - print '
'; + print 'attribute_required [$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) + print ''; + + print '
'; + print '>' . $label . '' . img_edit().'
'; + print '
'; + // Convert date into timestamp format if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); @@ -2057,8 +2064,6 @@ if ($action == 'create') else { print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->propal->creer) - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; } print '
trans("Unique"); ?>>
trans("Required"); ?>>
trans("AlwaysEditable"); ?>>

">   diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index e24a3e86948..dcf1af56ed1 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -54,6 +54,7 @@ $size=$extrafields->attribute_size[$attrname]; $unique=$extrafields->attribute_unique[$attrname]; $required=$extrafields->attribute_required[$attrname]; $pos=$extrafields->attribute_pos[$attrname]; +$alwayseditable=$extrafields->attribute_alwayseditable[$attrname]; $param=$extrafields->attribute_param[$attrname]; if((($type == 'select') || ($type == 'checkbox') ||(($type == 'radio'))) && is_array($param)) @@ -110,6 +111,8 @@ if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($typ trans("Unique"); ?>> trans("Required"); ?>> + +trans("AlwaysEditable"); ?>> diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 5e633eb2660..dfbf0676eae 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1096,3 +1096,5 @@ DELETE FROM llx_const WHERE name = 'MAIN_MODULE_BOUTIQUE'; DELETE FROM llx_const WHERE name = 'OSC_DB_HOST'; DELETE FROM llx_menu WHERE module = 'boutique'; +-- Add option always editable on extrafield +ALTER TABLE llx_extrafields ADD alwayseditable INT(11) NOT NULL AFTER pos; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_extrafields.sql b/htdocs/install/mysql/tables/llx_extrafields.sql index ba4c7df964f..04963eb3905 100644 --- a/htdocs/install/mysql/tables/llx_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_extrafields.sql @@ -22,7 +22,7 @@ create table llx_extrafields rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(64) NOT NULL, -- nom de l'attribut entity integer DEFAULT 1 NOT NULL, -- multi company id - elementtype varchar(64) NOT NULL DEFAULT 'member', + elementtype varchar(64) NOT NULL DEFAULT 'member', tms timestamp, label varchar(255) NOT NULL, -- label correspondant a l'attribut type varchar(8), @@ -30,5 +30,6 @@ create table llx_extrafields fieldunique integer DEFAULT 0, fieldrequired integer DEFAULT 0, pos integer DEFAULT 0, + alwayseditable integer DEFAULT 0, param text )ENGINE=innodb; From 68179c8794daf5063c18d857ea7fb52ac1835d22 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 14 Oct 2014 16:13:17 +0200 Subject: [PATCH 16/98] Always editable option for extrafields on invoice and order --- htdocs/commande/card.php | 19 +++++++++++++------ htdocs/compta/facture.php | 14 ++++++++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 136ade4df3c..f39d827b03e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -618,7 +618,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); - if ($result >= 0) + if ($result >= 0) { if (count($prodcustprice->lines) > 0) { @@ -628,9 +628,9 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; } } - else - { - setEventMessage($prodcustprice->error,'errors'); + else + { + setEventMessage($prodcustprice->error,'errors'); } } @@ -2152,9 +2152,16 @@ if ($action == 'create' && $user->rights->commande->creer) { } else { - print ''; + print 'attribute_required [$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) + print ''; + + print '
'; + print '>' . $label . '' . img_edit().'
'; + print ''; + // Convert date into timestamp format if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 245f187d166..22246fc8f03 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3341,10 +3341,16 @@ if ($action == 'create') if ($extrafields->attribute_type [$key] == 'separate') { print $extrafields->showSeparator($key); } else { - print 'attribute_required [$key])) - print ' class="fieldrequired"'; - print '>' . $label . ''; + print ''; + print 'attribute_required [$key])) print ' class="fieldrequired"'; + print '>' . $label . ''; + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) + print ''; + + print '
' . img_edit().'
'; + print ''; + // Convert date into timestamp format if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); From ee4b807a5d1512aa62b33f1f4d096cfb79654776 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 14 Oct 2014 17:00:06 +0200 Subject: [PATCH 17/98] Qual : refactoring extrafields display on objects into a single tpl file --- htdocs/comm/propal.php | 64 +------------- htdocs/commande/card.php | 64 +------------- htdocs/compta/facture.php | 55 +----------- htdocs/contrat/card.php | 48 +---------- htdocs/core/tpl/extrafields_view.tpl.php | 83 +++++++++++++++++++ htdocs/fichinter/card.php | 46 +--------- .../fourn/class/fournisseur.facture.class.php | 9 ++ htdocs/fourn/commande/card.php | 75 +---------------- htdocs/fourn/facture/card.php | 49 ++++++++++- 9 files changed, 155 insertions(+), 338 deletions(-) create mode 100644 htdocs/core/tpl/extrafields_view.tpl.php diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 1f211c3cb79..6cd70b273be 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2008,67 +2008,9 @@ if ($action == 'create') print ''; } - // Other attributes (TODO Move this into an include) - $res = $object->fetch_optionals($object->id, $extralabels); - $parameters = array('colspan' => ' colspan="3"'); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified - // by - // hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach ($extrafields->attribute_label as $key => $label) - { - if ($action == 'edit_extras') - { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); - } - else - { - $value = $object->array_options ["options_" . $key]; - } - if ($extrafields->attribute_type [$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print ''; - print 'attribute_required [$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; - if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) - print ''; - - print '
' . img_edit().'
'; - print ''; - - // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); - } - - if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - - print $extrafields->showInputField($key, $value); - - print ''; - - print '
'; - } - else - { - print $extrafields->showOutputField($key, $value); - } - print '' . "\n"; - } - } - } + // Other attributes + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; // Amount HT print '' . $langs->trans('AmountHT') . ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f39d827b03e..60e5d81e37a 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2130,67 +2130,9 @@ if ($action == 'create' && $user->rights->commande->creer) { print ''; } - // Other attributes (TODO Move this into an include) - $parameters = array('colspan' => ' colspan="3"'); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach ($extrafields->attribute_label as $key => $label) - { - if ($action == 'edit_extras') - { - $value = (isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - } - else - { - $value = $object->array_options["options_" . $key]; - } - - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print ''; - print 'attribute_required [$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; - if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) - print ''; - - print '
' . img_edit().'
'; - print ''; - - // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) - { - $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); - } - - if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - - print $extrafields->showInputField($key, $value); - - print ''; - print '
'; - } - else - { - print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->commande->creer) - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; - } - print '' . "\n"; - } - } - } + // Other attributes + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; $rowspan = 4; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 22246fc8f03..eb4ca29f022 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3324,58 +3324,9 @@ if ($action == 'create') print ''; } - // Other attributes (TODO Move this into an include) - $res = $object->fetch_optionals($object->id, $extralabels); - $parameters = array('colspan' => ' colspan="5"', "cols" => 5); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by - // hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach ($extrafields->attribute_label as $key => $label) - { - if ($action == 'edit_extras') { - $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options ["options_" . $key]); - } else { - $value = $object->array_options ["options_" . $key]; - } - if ($extrafields->attribute_type [$key] == 'separate') { - print $extrafields->showSeparator($key); - } else { - print ''; - print 'attribute_required [$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; - if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) - print ''; - - print '
' . img_edit().'
'; - print ''; - - // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); - } - - if ($action == 'edit_extras' && $user->rights->facture->creer && GETPOST('attribute') == $key) { - print '
'; - print ''; - print ''; - print ''; - print ''; - - print $extrafields->showInputField($key, $value); - - print ''; - print '
'; - } else { - print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->facture->creer) - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; - } - print '' . "\n"; - } - } - } + // Other attributes + $cols = 5; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
'; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 1b47912fa41..af5f83cdbde 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1189,52 +1189,8 @@ else } // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - - $res = $object->fetch_optionals($object->id, $extralabels); - if (empty($reshook) && ! empty($extrafields->attribute_label)) { - foreach ($extrafields->attribute_label as $key => $label) { - if ($action == 'edit_extras') { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); - } else { - $value = $object->array_options ["options_" . $key]; - } - if ($extrafields->attribute_type [$key] == 'separate') { - print $extrafields->showSeparator($key); - } else { - print 'attribute_required [$key])) - print ' class="fieldrequired"'; - print '>' . $label . ''; - // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); - } - - if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { - print '
'; - print ''; - print ''; - print ''; - print ''; - - print $extrafields->showInputField($key, $value); - - print ''; - print '
'; - } else { - print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->commande->creer) - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; - } - print '' . "\n"; - } - } - } - - - + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print ""; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php new file mode 100644 index 00000000000..1591ce9fb6d --- /dev/null +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -0,0 +1,83 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Need to have following variables defined: + * $object (invoice, order, ...) + * $conf + * $langs + * + * $cols + */ + +//$res = $object->fetch_optionals($object->id, $extralabels); +$parameters = array('colspan' => ' colspan="'.$cols.'"', 'cols' => $cols, 'socid' => $object->fk_soc); +$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); + +if (empty($reshook) && ! empty($extrafields->attribute_label)) +{ + foreach ($extrafields->attribute_label as $key => $label) + { + if ($action == 'edit_extras') + { + $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); + } + else + { + $value = $object->array_options ["options_" . $key]; + } + if ($extrafields->attribute_type [$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print ''; + print 'attribute_required [$key])) print ' class="fieldrequired"'; + print '>' . $label . ''; + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->propal->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) + print ''; + + print '
' . img_edit().'
'; + print ''; + + // Convert date into timestamp format + if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { + $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); + } + + if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key) + { + print '
'; + print ''; + print ''; + print ''; + print ''; + + print $extrafields->showInputField($key, $value); + + print ''; + + print '
'; + } + else + { + print $extrafields->showOutputField($key, $value); + } + print '' . "\n"; + } + } +} diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 70d425d04a1..983293916b6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1330,49 +1330,9 @@ else if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; - // Other attributes (TODO Move this into an include) - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - if ($action == 'edit_extras') { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - } else { - $value=$object->array_options["options_".$key]; - } - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - // Convert date into timestamp format - if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) - { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); - } - if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key) - { - print ''; - - print $extrafields->showInputField($key,$value); - - print '   '; - } - else - { - print $extrafields->showOutputField($key,$value); - if (($object->statut == 0 || $object->statut == 1) && $user->rights->ficheinter->creer) print '   '.img_picto('','edit').' '.$langs->trans('Modify').''; - } - print ''."\n"; - } - } - } + // Other attributes + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print ""; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e5ba7b3b1dd..9c72319f74f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -413,6 +413,15 @@ class FactureFournisseur extends CommonInvoice $this->socid = $obj->socid; $this->socnom = $obj->socnom; + + // Retreive all extrafield + // fetch optionals attributes and labels + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); + + if ($this->statut == 0) $this->brouillon = 1; $result=$this->fetch_lines(); if ($result < 0) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d6be5491f54..911a7a52159 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1484,78 +1484,9 @@ elseif (! empty($object->id)) print ''; } - // Other attributes (TODO Move this into an include) - $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - if ($action == 'edit_extras') - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - } - else - { - $value=$object->array_options["options_".$key]; - } - - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - // Convert date into timestamp format - if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) - { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); - } - - if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - - print $extrafields->showInputField($key, $value); - - print ''; - print '
'; - } - else - { - print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->commande->creer) - print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; - } - print ''."\n"; - } - } - - if(count($extrafields->attribute_label) > 0) - { - if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer) - { - print ''; - print ''; - print ''; - print ''; - } - else - { - if ($object->statut == 0 && $user->rights->fournisseur->commande->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } - } + // Other attributes + $cols = 3; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b58c17dcf62..c8db601a8d9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -72,6 +72,10 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); $hookmanager->initHooks(array('invoicesuppliercard','globalcard')); $object=new FactureFournisseur($db); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || ! empty($ref)) @@ -1054,6 +1058,45 @@ elseif ($action == 'remove_file') } } +elseif ($action == 'update_extras') +{ + // Fill array 'array_options' with data from add form + $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + + if($ret < 0) $error++; + + if (!$error) + { + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('supplierorderdao')); + $parameters=array('id'=>$object->id); + + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + + $result=$object->insertExtraFields(); + + if ($result < 0) + { + $error++; + } + + } + } + else if ($reshook < 0) $error++; + } + else + { + $action = 'edit_extras'; + } +} + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer) { if ($action == 'addcontact') @@ -1884,9 +1927,9 @@ else print ''; } - // Other options - $parameters=array('colspan' => ' colspan="4"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + // Other attributes + $cols = 4; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print ''; From 850771206d191a7674d7c8b8d6feeca263a01a9c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 14 Oct 2014 17:12:45 +0200 Subject: [PATCH 18/98] Changelog :) --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 57673bac498..8efb6c5858a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -65,6 +65,7 @@ For users: - New: Add feature to order to invoice on supplier part - Upgrade phpexcel lib to 1.7.8 - New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export +- New : Option on extrafields to have them always editable regardless of the document status - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem From 722f6e0db6a64132dc2e68606d288a80a346de03 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 15 Oct 2014 15:24:31 +0200 Subject: [PATCH 19/98] Fix right on product list --- htdocs/product/liste.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 40e99a2d2ee..cab06a7f387 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -467,7 +467,7 @@ else } // Better buy price - if ($user->rights->produit->creer) + if ($user->rights->fournisseur->lire) { print ''; if ($objp->minsellprice != '') From 5d57c59241cc6f99087166b74f8768924327fad4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2014 18:16:41 +0200 Subject: [PATCH 20/98] Fix: Bad parameter of get_substitutionarray_other --- .../core/modules/commande/doc/doc_generic_order_odt.modules.php | 2 +- .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 2 +- .../modules/project/doc/doc_generic_project_odt.modules.php | 2 +- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 2 +- .../modules/propale/doc/doc_generic_proposal_odt.modules.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 51a3a13ff58..1b7da875073 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -334,7 +334,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 2ad6b87643a..2ca90b13ace 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -343,7 +343,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array(); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 93df313ad4c..1364aeff65e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -504,7 +504,7 @@ class doc_generic_project_odt extends ModelePDFProjects $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index c5043857469..7f93851cc65 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -490,7 +490,7 @@ class doc_generic_task_odt extends ModelePDFTask $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($project,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 080c781b404..8f79094befc 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -368,7 +368,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs); - $array_other=$this->get_substitutionarray_other($user,$outputlangs); + $array_other=$this->get_substitutionarray_other($outputlangs); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); complete_substitutions_array($tmparray, $outputlangs, $object); From 38e4100e475b24a4e8319c683238684d5c2f7067 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2014 18:21:18 +0200 Subject: [PATCH 21/98] Better translation: Virtual product is a "package product". --- htdocs/langs/en_US/products.lang | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index d5b1db83495..b38bcd150a9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -117,12 +117,12 @@ ServiceLimitedDuration=If product is a service with limited duration: MultiPricesAbility=Several level of prices per product/service MultiPricesNumPrices=Number of prices MultiPriceLevelsName=Price categories -AssociatedProductsAbility=Activate the virtual products feature -AssociatedProducts=Virtual product -AssociatedProductsNumber=Number of products composing this virtual product -ParentProductsNumber=Number of parent virtual product -IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product -IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product +AssociatedProductsAbility=Activate the virtual package feature +AssociatedProducts=Package product +AssociatedProductsNumber=Number of products composing this virtual package product +ParentProductsNumber=Number of parent packaging product +IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual package product +IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual package product EditAssociate=Associate Translation=Translation KeywordFilter=Keyword filter @@ -132,7 +132,7 @@ AddDel=Add/Delete Quantity=Quantity NoMatchFound=No match found ProductAssociationList=List of related products/services: name of product/service (quantity affected) -ProductParentList=List of virtual products/services with this product as a component +ProductParentList=List of package products/services with this product as a component ErrorAssociationIsFatherOfThis=One of selected product is parent with current product DeleteProduct=Delete a product/service ConfirmDeleteProduct=Are you sure you want to delete this product/service? @@ -179,7 +179,7 @@ CloneProduct=Clone product or service ConfirmCloneProduct=Are you sure you want to clone product or service %s ? CloneContentProduct=Clone all main informations of product/service ClonePricesProduct=Clone main informations and prices -CloneCompositionProduct=Clone virtual product/services +CloneCompositionProduct=Clone packaged product/services ProductIsUsed=This product is used NewRefForClone=Ref. of new product/service CustomerPrices=Customers prices From 2f4822e73b834fd026c7627ff61adee6a6c456a6 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 15 Oct 2014 20:43:32 +0200 Subject: [PATCH 22/98] Merge --- htdocs/projet/tasks/time.php | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 13b1e48f477..676b17a5951 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -292,37 +292,37 @@ if ($id > 0 || ! empty($ref)) // Label print ''.$langs->trans("Label").''.$object->label.''; - // Date start - print ''.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'dayhour'); - print ''; - - // Date end - print ''.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'dayhour'); - print ''; - - // Planned workload - print ''.$langs->trans("PlannedWorkload").''; - print convertSecondToTime($object->planned_workload,'allhourmin'); - print ''; - - // Progress declared - print ''.$langs->trans("ProgressDeclared").''; - print $object->progress.' %'; - print ''; - - // Progress calculated + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'dayhour'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'dayhour'); + print ''; + + // Planned workload + print ''.$langs->trans("PlannedWorkload").''; + print convertSecondToTime($object->planned_workload,'allhourmin'); + print ''; + + // Progress declared + print ''.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print ''; + + // Progress calculated print ''.$langs->trans("ProgressCalculated").''; if ($object->planned_workload) { - $tmparray=$object->getSummaryOfTimeSpent(); + $tmparray=$object->getSummaryOfTimeSpent(); if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %'; else print '0 %'; } - else print ''; - print ''; - + else print ''; + print ''; + // Project if (empty($withproject)) { From b90011aeb19857d72738f1ff6254b882c2e3746d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 01:01:30 +0200 Subject: [PATCH 23/98] Add function dolEscapeXML --- htdocs/core/lib/functions.lib.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index edf0b1b9dcd..7b79adc86c4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -453,6 +453,18 @@ function dol_string_nospecial($str,$newstr='_',$badchars='') return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str)); } + +/** + * Encode string for xml usage + * + * @param string $string String to encode + * @return string String encoded + */ +function dolEscapeXML($string) +{ + return strtr($string, array('\''=>''','"'=>'"','&'=>'&','<'=>'<','>'=>'>')); +} + /** * Returns text escaped for inclusion into javascript code * @@ -3715,6 +3727,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) } } + /** * This function is called to encode a string into a HTML string but differs from htmlentities because * all entities but &,<,> are converted. This permits to encode special chars to entities with no double From c8dd0383d8b5aea6dec5e92ffe3dfa2bc9db70ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 01:26:44 +0200 Subject: [PATCH 24/98] New: Function getCurrencyAmount is marked as deprecated. Use function price to output a price including currency symbol. --- ChangeLog | 2 ++ htdocs/core/class/translate.class.php | 1 + 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 57673bac498..8e48a5fc67d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -120,6 +120,8 @@ For developers: - New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: Added hook "formConfirm" and "doActions" for fichinter card - New: Can search list of thirdparties from web service on part of name. +- New: Function getCurrencyAmount is marked as deprecated. Use function price to output a price + including currency symbol. - Qual: Renamed table llx_c_civilite into llx_c_civility, field civilite into label in the same table, and field civilite into civility in other table. diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 7462a40e897..6b24d5356df 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -701,6 +701,7 @@ class Translate * @param string $currency_code Currency Code * @param string $amount If not '', show currency + amount according to langs ($10, 10€). * @return string Amount + Currency symbol encoded into UTF8 + * @deprecated Use method price to output a price */ function getCurrencyAmount($currency_code, $amount) { From c1d016a5312ed9ef945ba41a2d9424fd96cf6389 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Oct 2014 06:20:54 +0200 Subject: [PATCH 25/98] Add field to select color of the user in user's card --- htdocs/comm/action/index.php | 4 +- htdocs/langs/en_US/users.lang | 3 +- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/card.php | 138 ++++++++++++++++++++----------- htdocs/user/class/user.class.php | 40 +++++---- 5 files changed, 120 insertions(+), 67 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2db6936e1d3..00d73256f26 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1146,11 +1146,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (in_array($user->id, $keysofuserassigned)) { $nummytasks++; $cssclass='family_mytasks'; - // TODO Set a color using user color + // Must defined rule to choose color of who to use. // event->ownerid will still contains user id of owner // event->userassigned will be an array in future. - // $color=$user->color; + $color=$user->color; } else if ($event->type_code == 'ICALEVENT') { diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 495cb3981c6..c13e3e767bb 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -119,4 +119,5 @@ HierarchicView=Hierarchical view UseTypeFieldToChange=Use field Type to change OpenIDURL=OpenID URL LoginUsingOpenID=Use OpenID to login -WeeklyHours=Weekly hours \ No newline at end of file +WeeklyHours=Weekly hours +ColorUser=Color of the user \ No newline at end of file diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 4109e7ab9a4..1993f12bd5c 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -46,7 +46,7 @@ $actionsave=GETPOST('save','alpha'); if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; -// List of aviable colors +// List of available colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); // Security check diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 01b6ec32f52..4e17875f1ed 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); @@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) } } -// Action ajout user +// Action Add user if ($action == 'add' && $canadduser) { $error = 0; @@ -205,6 +206,8 @@ if ($action == 'add' && $canadduser) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; + + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -258,7 +261,7 @@ if ($action == 'add' && $canadduser) } } -// Action ajout groupe utilisateur +// Action add usergroup if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) { if ($group) @@ -350,6 +353,8 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; + + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -589,6 +594,7 @@ if ($action == 'adduserldap') */ $form = new Form($db); +$formother=new FormOther($db); llxHeader('',$langs->trans("UserCard")); @@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap')) setEventMessage($ldap->error, 'errors'); } - // Si la liste des users est rempli, on affiche la liste deroulante + // If user list is full, we show drop-down list print "\n\n\n"; print '
'; @@ -767,7 +773,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } $password=$generated_password; - // Mot de passe + // Password print ''.$langs->trans("Password").''; print ''; if (! empty($ldap_sid)) @@ -789,7 +795,7 @@ if (($action == 'create') || ($action == 'adduserldap')) } print ''; - // Administrateur + // Administrator if (! empty($user->admin)) { print ''.$langs->trans("Administrator").''; @@ -974,6 +980,15 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; print ''; print "\n"; + + // User color + if (! empty($conf->agenda->enabled)) + { + print ''.$langs->trans("ColorUser").''; + print ''; + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print ''; + } // Note print ''; @@ -1002,7 +1017,7 @@ else { /* ************************************************************************** */ /* */ - /* Visu et edition */ + /* View and edition */ /* */ /* ************************************************************************** */ @@ -1032,7 +1047,7 @@ else $userDisabled = 0; $statutUACF = ''; - //On verifie les options du compte + // Check options of user account if (count($ldap->uacf) > 0) { foreach ($ldap->uacf as $key => $statut) @@ -1080,7 +1095,7 @@ else } /* - * Confirmation desactivation + * Confirm deactivation */ if ($action == 'disable') { @@ -1088,7 +1103,7 @@ else } /* - * Confirmation activation + * Confirm activation */ if ($action == 'enable') { @@ -1108,13 +1123,13 @@ else */ if ($action != 'edit') { - $rowspan=16; - + $rowspan=17; + print ''; // Ref print ''; - print ''; print ''."\n"; @@ -1123,10 +1138,12 @@ else if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->skype->enabled)) $rowspan++; + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; + if (! empty($conf->agenda->enabled)) $rowspan++; // Lastname print ''; - print ''; + print ''; // Photo print ''; - print ''; + print ''; print ''."\n"; // Position/Job print ''; - print ''; + print ''; print ''."\n"; // Login print ''; if (! empty($object->ldap_sid) && $object->statut==0) { - print ''; + print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -1163,24 +1180,24 @@ else { if ($passDoNotExpire) { - print ''; + print ''; } else if($userChangePassNextLogon) { - print ''; + print ''; } else if($userDisabled) { - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''."\n"; // Administrator - print ''."\n"; // Type - print ''."\n"; } // Tel pro print ''; - print ''; + print ''; print ''."\n"; // Tel mobile print ''; - print ''; + print ''; print ''."\n"; // Fax print ''; - print ''; + print ''; print ''."\n"; // Skype if (! empty($conf->skype->enabled)) { - print ''; - print ''; + print ''; + print ''; print "\n"; } // EMail print ''; - print ''; + print ''; print "\n"; // Signature - print '\n"; // Hierarchy print ''; - print ''; print "\n"; - if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { $langs->load("salaries"); // THM print ''; - print ''; print "\n"; // TJM print ''; - print ''; print "\n"; // Salary print ''; - print ''; print "\n"; @@ -1296,7 +1313,7 @@ else // Weeklyhours print ''; - print ''; print "\n"; @@ -1306,28 +1323,39 @@ else { $rowspan++; print ''; - print ''; + print ''; + } + + // Color user + if (! empty($conf->agenda->enabled)) + { + print ''; + print ''; + print ''; + print "\n"; } // Status print ''; - print ''; print ''."\n"; print ''; - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) { print ''; - print ''; + print ''; print "\n"; } @@ -1335,7 +1363,7 @@ else if (! empty($conf->societe->enabled)) { print ''; - print ''; - print ''; @@ -1957,7 +1988,7 @@ else print ''; print "\n"; - if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) { $langs->load("salaries"); @@ -2008,6 +2039,15 @@ else print ''; print ""; } + + // User color + if (! empty($conf->agenda->enabled)) + { + print ''; + print ''; + } // Status print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4afd650f4ae..8b06d3b9bdf 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -51,7 +51,7 @@ class User extends CommonObject var $firstname; var $note; var $email; - var $skype; + var $skype; var $job; var $signature; var $office_phone; @@ -101,13 +101,14 @@ class User extends CommonObject var $users; // To store all tree of users hierarchy var $parentof; // To store an array of all parents for all ids. - var $accountancy_code; // Accountancy code in prevision of the complete accountancy module - var $thm; // Average cost of employee - var $tjm; // Average cost of employee - var $salary; // Monthly salary - var $salaryextra; // Monthly salary extra - var $weeklyhours; // Weekly hours + var $accountancy_code; // Accountancy code in prevision of the complete accountancy module + var $thm; // Average cost of employee + var $tjm; // Average cost of employee + var $salary; // Monthly salary + var $salaryextra; // Monthly salary extra + var $weeklyhours; // Weekly hours + var $color; // Define background color for user in agenda /** * Constructor de la classe @@ -166,6 +167,7 @@ class User extends CommonObject $sql.= " u.salary,"; $sql.= " u.salaryextra,"; $sql.= " u.weeklyhours,"; + $sql.= " u.color,"; $sql.= " u.ref_int, u.ref_ext"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -233,6 +235,7 @@ class User extends CommonObject $this->salary = $obj->salary; $this->salaryextra = $obj->salaryextra; $this->weeklyhours = $obj->weeklyhours; + $this->color = $obj->color; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); @@ -270,7 +273,7 @@ class User extends CommonObject return -1; } - // Recupere parametrage global propre a l'utilisateur + // To get back the global configuration unique to the user if ($loadpersonalconf) { $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; @@ -302,7 +305,7 @@ class User extends CommonObject } /** - * Ajoute un droit a l'utilisateur + * Add a right to the user * * @param int $rid id du droit a ajouter * @param string $allmodule Ajouter tous les droits du module allmodule @@ -404,7 +407,7 @@ class User extends CommonObject /** - * Retire un droit a l'utilisateur + * Remove a right to the user * * @param int $rid Id du droit a retirer * @param string $allmodule Retirer tous les droits du module allmodule @@ -672,7 +675,7 @@ class User extends CommonObject $this->db->begin(); - // Desactive utilisateur + // Deactivate user $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql.= " SET statut = ".$this->statut; $sql.= " WHERE rowid = ".$this->id; @@ -717,7 +720,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); - // Supprime droits + // Remove rights $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id; if (! $error && ! $this->db->query($sql)) @@ -734,7 +737,7 @@ class User extends CommonObject $this->error = $this->db->lasterror(); } - // Si contact, supprime lien + // If contact, remove link if ($this->contact_id) { $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; @@ -1063,7 +1066,7 @@ class User extends CommonObject } /** - * Affectation des permissions par defaut + * Assign rights by default * * @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes */ @@ -1142,6 +1145,7 @@ class User extends CommonObject $this->zip = empty($this->zip)?'':$this->zip; $this->town = empty($this->town)?'':$this->town; $this->accountancy_code = trim($this->accountancy_code); + $this->color = empty($this->color)?'':$this->color; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1150,6 +1154,13 @@ class User extends CommonObject $this->error = $langs->trans("ErrorBadEMail",$this->email); return -1; } + + if (empty($this->color)) + { + $langs->load("errors"); + $this->error = $langs->trans("ErrorColor",$this->color); + return -1; + } $this->db->begin(); @@ -1172,6 +1183,7 @@ class User extends CommonObject $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; + $sql.= ", color = '".$this->db->escape($this->color)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); From 8e3a3500c25f594474c6093d093dce86b3aa89ee Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 16 Oct 2014 13:28:39 +0200 Subject: [PATCH 26/98] Add comments (for travis' sake) --- htdocs/core/class/extrafields.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9075cac94e3..db24d257aee 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -105,6 +105,7 @@ class ExtraFields * @param int $required Is field required or not * @param string $default_value Defaulted value * @param array $param Params for field + * @param int $alwayseditable Is attribute always editable regardless of the document status * @return int <=0 if KO, >0 if OK */ function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0) @@ -219,6 +220,7 @@ class ExtraFields * @param int $unique Is field unique or not * @param int $required Is field required or not * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status * @return int <=0 if KO, >0 if OK */ private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0) @@ -350,6 +352,7 @@ class ExtraFields * @param int $required Is field required or not * @param int $pos Position of attribute * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status * @return int >0 if OK, <=0 if KO */ function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0) @@ -435,6 +438,7 @@ class ExtraFields * @param int $required Is field required or not * @param int $pos Position of attribute * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @param int $alwayseditable Is attribute always editable regardless of the document status * @return int <=0 if KO, >0 if OK */ private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0) From eeffe4ed34aa28d149a1234fac2b1e5521fc8996 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 16 Oct 2014 13:57:07 +0200 Subject: [PATCH 27/98] Reload object when product clone failed (cause of ref already exists) if not done result is blanck pages (header wannot be rewrite (location herder index.php) around line 1542 --- htdocs/product/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index a73d5817b3a..7e5b9b76c78 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -422,10 +422,10 @@ if (empty($reshook)) $_error++; $action = ""; - $mesg='
'.$langs->trans("ErrorProductAlreadyExists",$object->ref); + $mesg=$langs->trans("ErrorProductAlreadyExists",$object->ref); $mesg.=' '.$langs->trans("ShowCardHere").'.'; - $mesg.='
'; setEventMessage($mesg, 'errors'); + $object->fetch($id); //dol_print_error($object->db); } else From 08c9ff275a8b694e2aad05a7abd3ae7d2b7a50ba Mon Sep 17 00:00:00 2001 From: Cubexed Date: Thu, 16 Oct 2014 18:09:16 +0200 Subject: [PATCH 28/98] Added date start/end at webservice createOrder --- htdocs/webservices/server_order.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 8916ff011ed..9903c6b4ed9 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -664,6 +664,8 @@ function createOrder($authentication,$order) $newline->total_ht=$line['total_net']; $newline->total_tva=$line['total_vat']; $newline->total_ttc=$line['total']; + $newline->date_start=$line['date_start']; + $newline->date_end=$line['date_end']; $newobject->lines[]=$newline; } From 7a68d9a940fb5a3431368545ae4b62fc20cb55d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 20:55:13 +0200 Subject: [PATCH 29/98] Miscellaneous fixes --- htdocs/adherents/index.php | 2 +- htdocs/categories/index.php | 2 +- htdocs/compta/bank/index.php | 6 +++++- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/company.lib.php | 11 ++++++----- htdocs/core/lib/functions.lib.php | 2 +- htdocs/product/index.php | 2 +- htdocs/societe/consumption.php | 4 ++-- htdocs/societe/index.php | 2 +- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1ec3d71c664..62e54c17948 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -159,7 +159,7 @@ if ($conf->use_javascript_ajax) print '
'; print '
'.$langs->trans("Ref").''; + print ''; print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$object->lastname.''.$object->lastname.''; @@ -1137,23 +1154,23 @@ else // Firstname print '
'.$langs->trans("Firstname").''.$object->firstname.''.$object->firstname.'
'.$langs->trans("PostOrFunction").''.$object->job.''.$object->job.'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.''.$object->login.'
'.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("LdapUacf_".$statutUACF).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''.$langs->trans("DomainPassword").''.$langs->trans("DomainPassword").''; + print ''; if ($object->pass) print preg_replace('/./i','*',$object->pass); else { @@ -1192,7 +1209,7 @@ else print '
'.$langs->trans("Administrator").''; + print '
'.$langs->trans("Administrator").''; if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); @@ -1208,7 +1225,7 @@ else print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; $type=$langs->trans("Internal"); if ($object->societe_id) $type=$langs->trans("External"); print $form->textwithpicto($type,$langs->trans("InternalExternalDesc")); @@ -1218,47 +1235,47 @@ else // Ldap sid if ($object->ldap_sid) { - print '
'.$langs->trans("Type").''; + print '
'.$langs->trans("Type").''; print $langs->trans("DomainUser",$ldap->domainFQDN); print '
'.$langs->trans("PhonePro").''.dol_print_phone($object->office_phone,'',0,0,1).''.dol_print_phone($object->office_phone,'',0,0,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->user_mobile,'',0,0,1).''.dol_print_phone($object->user_mobile,'',0,0,1).'
'.$langs->trans("Fax").''.dol_print_phone($object->office_fax,'',0,0,1).''.dol_print_phone($object->office_fax,'',0,0,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,0,1).'
'.$langs->trans("EMail").''.dol_print_email($object->email,0,0,1).''.dol_print_email($object->email,0,0,1).'
'.$langs->trans('Signature').''; + print '
'.$langs->trans('Signature').''; print dol_htmlentitiesbr($object->signature); print "
'.$langs->trans("HierarchicalResponsible").''; + print ''; if (empty($object->fk_user)) print $langs->trans("None"); else { $huser=new User($db); @@ -1268,27 +1285,27 @@ else print '
'.$langs->trans("THM").''; + print ''; print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("TJM").''; + print ''; print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("Salary").''; + print ''; print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print '
'.$langs->trans("WeeklyHours").''; + print ''; print price2num($object->weeklyhours); print '
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.''.$object->accountancy_code.'
'.$langs->trans("ColorUser").''; + print $object->color; + print ' 
'.$langs->trans("Status").''; + print ''; print $object->getLibStatut(4); print '
'.$langs->trans("LastConnexion").''.dol_print_date($object->datelastlogin,"dayhour").''.dol_print_date($object->datelastlogin,"dayhour").'
'.$langs->trans("PreviousConnexion").''.dol_print_date($object->datepreviouslogin,"dayhour").''.dol_print_date($object->datepreviouslogin,"dayhour").'
'.$langs->trans("OpenIDURL").''.$object->openid.''.$object->openid.'
'.$langs->trans("LinkToCompanyContact").''; + print ''; if (isset($object->societe_id) && $object->societe_id > 0) { $societe = new Societe($db); @@ -1363,7 +1391,7 @@ else { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; + print ''; if ($object->fk_member) { $adh=new Adherent($db); @@ -1631,7 +1659,10 @@ else if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; - + if (! empty($conf->skype->enabled)) $rowspan++; + if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; + if (! empty($conf->agenda->enabled)) $rowspan++; + print ''; print ''; print ''; @@ -1696,7 +1727,7 @@ else print ''; } else - { + { print ''; print $object->job; } @@ -1918,7 +1949,7 @@ else print $doleditor->Create(1); } else - { + { print dol_htmlentitiesbr($object->signature); } print '
'.$langs->trans("ColorUser").''; + print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset'); + print '
'.$langs->trans("Status").'
'; print ''; - print ''; } diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 921b1739767..e6961ed97dd 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -233,7 +233,11 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; } } -if (! $found) print ''; +if (! $found) +{ + $var = !$var; + print ''; +} // Total foreach ($total as $key=>$solde) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d4effca3905..b26147918ca 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -193,7 +193,7 @@ class Form { $ret.=''; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c5ba612b60f..7236d411c22 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -128,7 +128,7 @@ function societe_prepare_head($object) else { dol_print_error($db); } - + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; @@ -492,7 +492,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $projectstatic = new Project($db); $i=0; - $var=true; + $var=false; while ($i < $num) { $obj = $db->fetch_object($result); @@ -521,8 +521,9 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') } } else - { - print ''; + { + $var = false; + print ''; } $db->free($result); } @@ -680,7 +681,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $result = $db->query($sql); $num = $db->num_rows($result); - $var=true; + $var=false; if ($num) { $i=0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7b79adc86c4..1b76d0e3572 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -670,7 +670,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p { $isactive=(is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]); - $out.='
'; + $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 3e18cc5d042..45f90823747 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -173,7 +173,7 @@ if (! empty($conf->categorie->enabled)) print '
'; print '
'.$langs->trans("Statistics").'
'; + print '
'; $SommeA=0; $SommeB=0; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index eceeb2890bc..76a19c91d7d 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -171,7 +171,7 @@ $nbofentries=(count($data) - 1); if ($nbofentries > 0) { - print '
'; + print '
'; tree_recur($data,$data[0],0); print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; $ret.=''; - $ret.='
'."\n"; + //$ret.='
'."\n"; $ret.=''; $ret.='
'.$langs->trans("None").'
'.$langs->trans("None").'
'; print ''; - print ''; + print ''; } else { - print ''; + print ''; } print "
'.$langs->trans("Categories").'
'; + print '
'; $sql = "SELECT c.label, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0aa9f0e5979..f89212e5fbc 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -494,10 +494,10 @@ if ($sql_select) } else if (empty($type_element) || $type_element == -1) { - print '
'.$langs->trans("SelectElementAndClickRefresh").'
'.$langs->trans("SelectElementAndClickRefresh").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureNotYetAvailable").'
"; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 740a6157809..243b55f01ca 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -183,7 +183,7 @@ if (! empty($conf->categorie->enabled)) print '
'; print ''; print ''; - print ''; print ''; print ''; + print ''; - print ''; print ''; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1b76d0e3572..19c5ce79c82 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2639,10 +2639,11 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath * @param int $num number of records found by select with limit+1 * @param int $totalnboflines Total number of records/lines for all pages (if known) * @param string $picto Icon to use before title (should be a 32x32 transparent png file) - * @param int $pictoisfullpath 1=Icon name is a full absolute url of image + * @param int $pictoisfullpath 1=Icon name is a full absolute url of image + * @param string $morehtml More html to show * @return void */ -function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0) +function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0, $morehtml='') { global $conf,$langs; @@ -2718,6 +2719,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } } print_fleche_navigation($page,$file,$options,$nextpage,$pagelist); + if ($morehtml) print $morehtml; print ''; print '
'.$langs->trans("Categories").'
'; + print '
'; $sql = "SELECT c.label, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; From b4a9e6a119d3712f106bda6d9c893b52579cee90 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 16 Oct 2014 21:14:57 +0200 Subject: [PATCH 30/98] Fix :: Administrator not created on new install --- htdocs/user/class/user.class.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 8b06d3b9bdf..91f85d4cb0b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1155,13 +1155,6 @@ class User extends CommonObject return -1; } - if (empty($this->color)) - { - $langs->load("errors"); - $this->error = $langs->trans("ErrorColor",$this->color); - return -1; - } - $this->db->begin(); // Mise a jour autres infos From e2524fbf774cfcc3c6a3afdc637866520e3adfe4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 21:34:35 +0200 Subject: [PATCH 31/98] Fxi: Filter on list view was not correct. --- htdocs/comm/action/listactions.php | 25 ++++++++++++++++++------- htdocs/core/lib/functions.lib.php | 6 ++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index fbd63e4006b..046ec450c26 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -44,6 +44,8 @@ $status=GETPOST("status",'alpha'); $type=GETPOST('type'); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); +$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); +$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); @@ -123,13 +125,19 @@ if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) * View */ +$form=new Form($db); + +$nav=''; +$nav.='   '; +$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); +$nav.=' '; +$nav.=''; + $now=dol_now(); $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -$form=new Form($db); - // Define list of all external calendars $listofextcals=array(); @@ -188,8 +196,9 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } -//if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1).'"'; -if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1)."'"; +if ($dateselect > 0) $sql.= " AND a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'"; +if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'"; +if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); //print $sql; @@ -236,7 +245,7 @@ if ($resql) } */ - print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0,''); + print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav); //print '
'; print '
'."\n"; @@ -259,9 +268,11 @@ if ($resql) print '
'; - print $form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); + print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1); + print ''; + print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1); print '
'."\n"; From 5bd665f10d062640760174bc42f8e026fc040601 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 17 Oct 2014 09:53:17 +0200 Subject: [PATCH 32/98] Update functions2.lib.php disable entity filter fields for module who not use multicompany fields --- htdocs/core/lib/functions2.lib.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e6f6228eec9..2272fb49988 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -573,17 +573,18 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti /** * Return last or next value for a mask (according to area we should not reset) * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param string $mask Mask to use * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter * @param string $where To add a filter on selection (for exemple to filter on invoice types) * @param Societe $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. - * @param string $mode 'next' for next value or 'last' for last value - * @return string New value (numeric) or error message + * @param string $mod 'next' for next value or 'last' for last value + * @param integer $bentityon enable or disable the entity filter (for modules not compatible with multicompany) + * @return string New value (numeric) or error message */ -function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next') +function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=1) { global $conf; @@ -784,7 +785,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bEntityOn) // only if entity enable + $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; From 589a3fdf952fe4a075cb581d1158d0e14785429c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 17 Oct 2014 10:26:34 +0200 Subject: [PATCH 33/98] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 2272fb49988..4b206f852fc 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -580,11 +580,11 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti * @param string $where To add a filter on selection (for exemple to filter on invoice types) * @param Societe $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. - * @param string $mod 'next' for next value or 'last' for last value - * @param integer $bentityon enable or disable the entity filter (for modules not compatible with multicompany) + * @param string $mode 'next' for next value or 'last' for last value + * @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany) * @return string New value (numeric) or error message */ -function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=1) +function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true) { global $conf; From 7988532e4e11f602c76087a9988abe78b8f7254a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 12:56:54 +0200 Subject: [PATCH 34/98] Fix: Bad closing tab on preview pages. --- htdocs/comm/propal/apercu.php | 9 ++++----- htdocs/commande/apercu.php | 9 ++++----- htdocs/compta/facture/apercu.php | 8 ++++---- htdocs/fichinter/apercu.php | 18 ++++++++++++------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index ce80783c731..e575c8f27fc 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -186,7 +186,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -199,13 +199,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print '

'; - -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index abb2be95076..839ca73d5b9 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -206,7 +206,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -219,13 +219,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print ''; - -$db->close(); llxFooter(); + +$db->close(); diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index ee197e9cee3..211d9241a8f 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -398,7 +398,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -411,12 +411,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -$db->close(); - llxFooter(); + +$db->close(); diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 4edd52809df..65721bdcce1 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * @@ -40,6 +40,11 @@ $ref = GETPOST('ref','alpha'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); + +/* + * View + */ + llxHeader(); $form = new Form($db); @@ -154,6 +159,8 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + + dol_fiche_end(); } else { @@ -165,7 +172,7 @@ if ($id > 0 || ! empty($ref)) // Si fichier png PDF d'1 page trouve if (file_exists($fileimage)) { - print ''; + print ''; } // Si fichier png PDF de plus d'1 page trouve elseif (file_exists($fileimagebis)) @@ -178,13 +185,12 @@ elseif (file_exists($fileimagebis)) if (file_exists($dir_output.$preview)) { - print '

'; + print '

'; } } } -print ''; - -$db->close(); llxFooter(); + +$db->close(); From 78d289110d94d9182cf2eead8afcf603aa3da8ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 13:07:23 +0200 Subject: [PATCH 35/98] Trans: Same verb --- htdocs/langs/en_US/agenda.lang | 2 +- htdocs/langs/en_US/bills.lang | 2 +- htdocs/langs/en_US/commercial.lang | 6 +++--- htdocs/langs/en_US/companies.lang | 12 ++++++------ htdocs/langs/en_US/contracts.lang | 2 +- htdocs/langs/en_US/donations.lang | 2 +- htdocs/langs/en_US/interventions.lang | 2 +- htdocs/langs/en_US/members.lang | 4 ++-- htdocs/langs/en_US/orders.lang | 2 +- htdocs/langs/en_US/other.lang | 1 - htdocs/langs/en_US/projects.lang | 4 ++-- htdocs/langs/en_US/propal.lang | 2 +- htdocs/langs/en_US/resource.lang | 2 +- htdocs/langs/en_US/suppliers.lang | 2 +- htdocs/langs/en_US/trips.lang | 2 +- 15 files changed, 23 insertions(+), 24 deletions(-) diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 227f7a61118..84383b46f1f 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -89,5 +89,5 @@ ExtSiteUrlAgenda=URL to access .ical file ExtSiteNoLabel=No Description WorkingTimeRange=Working time range WorkingDaysRange=Working days range -AddEvent=Add event +AddEvent=Create event MyAvailability=My availability \ No newline at end of file diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 0af0a26fd19..420a5eb44fb 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -87,7 +87,7 @@ ClassifyCanceled=Classify 'Abandoned' ClassifyClosed=Classify 'Closed' ClassifyUnBilled=Classify 'Unbilled' CreateBill=Create Invoice -AddBill=Add invoice or credit note +AddBill=Create invoice or credit note AddToDraftInvoices=Add to draft invoice DeleteBill=Delete invoice SearchACustomerInvoice=Search for a customer invoice diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 73c399eb604..390a7f837e8 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -9,9 +9,9 @@ Prospect=Prospect Prospects=Prospects DeleteAction=Delete an event/task NewAction=New event/task -AddAction=Add event/task -AddAnAction=Add an event/task -AddActionRendezVous=Add a Rendez-vous event +AddAction=Create event/task +AddAnAction=Create an event/task +AddActionRendezVous=Create a Rendez-vous event Rendez-Vous=Rendezvous ConfirmDeleteAction=Are you sure you want to delete this event/task ? CardAction=Event card diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 06c350039a3..7bfaf799f3a 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -259,8 +259,8 @@ AvailableGlobalDiscounts=Absolute discounts available DiscountNone=None Supplier=Supplier CompanyList=Company's list -AddContact=Add contact -AddContactAddress=Add contact/address +AddContact=Create contact +AddContactAddress=Create contact/address EditContact=Edit contact EditContactAddress=Edit contact/address Contact=Contact @@ -268,8 +268,8 @@ ContactsAddresses=Contacts/Addresses NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefined=No contact defined DefaultContact=Default contact/address -AddCompany=Add company -AddThirdParty=Add third party +AddCompany=Create company +AddThirdParty=Create third party DeleteACompany=Delete a company PersonalInformations=Personal data AccountancyCode=Accountancy code @@ -379,8 +379,8 @@ DeliveryAddressLabel=Delivery address label DeleteDeliveryAddress=Delete a delivery address ConfirmDeleteDeliveryAddress=Are you sure you want to delete this delivery address? NewDeliveryAddress=New delivery address -AddDeliveryAddress=Add address -AddAddress=Add address +AddDeliveryAddress=Create address +AddAddress=Create address NoOtherDeliveryAddress=No alternative delivery address defined SupplierCategory=Supplier category JuridicalStatus200=Independant diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 8a554a9770b..e06aadef531 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -27,7 +27,7 @@ MenuRunningServices=Running services MenuExpiredServices=Expired services MenuClosedServices=Closed services NewContract=New contract -AddContract=Add contract +AddContract=Create contract SearchAContract=Search a contract DeleteAContract=Delete a contract CloseAContract=Close a contract diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 66ddea95a5c..85dfdd8ff4d 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -4,7 +4,7 @@ Donations=Donations DonationRef=Donation ref. Donor=Donor Donors=Donors -AddDonation=Add a donation +AddDonation=Create a donation NewDonation=New donation ShowDonation=Show donation DonationPromise=Gift promise diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 17641a0ab3e..70fcbf7f22d 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -3,7 +3,7 @@ Intervention=Intervention Interventions=Interventions InterventionCard=Intervention card NewIntervention=New intervention -AddIntervention=Add intervention +AddIntervention=Create intervention ListOfInterventions=List of interventions EditIntervention=Edit intervention ActionsOnFicheInter=Actions on intervention diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index fd17000a8e0..b789f2f8423 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -85,7 +85,7 @@ SubscriptionLateShort=Late SubscriptionNotReceivedShort=Never received ListOfSubscriptions=List of subscriptions SendCardByMail=Send card by Email -AddMember=Add member +AddMember=Create member NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types" NewMemberType=New member type WelcomeEMail=Welcome e-mail @@ -125,7 +125,7 @@ Date=Date DateAndTime=Date and time PublicMemberCard=Member public card MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe -AddSubscription=Add subscription +AddSubscription=Create subscription ShowSubscription=Show subscription MemberModifiedInDolibarr=Member modified in Dolibarr SendAnEMailToMember=Send information email to member diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index d50f8615dc8..76986b67621 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -65,7 +65,7 @@ ValidateOrder=Validate order UnvalidateOrder=Unvalidate order DeleteOrder=Delete order CancelOrder=Cancel order -AddOrder=Add order +AddOrder=Create order AddToMyOrders=Add to my orders AddToOtherOrders=Add to other orders AddToDraftOrders=Add to draft order diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 6758b2b482e..10e4403f4fb 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -1,7 +1,6 @@ # Dolibarr language file - Source file is en_US - other SecurityCode=Security code Calendar=Calendar -AddTrip=Add trip Tools=Tools ToolsDesc=This area is dedicated to group miscellaneous tools not available into other menu entries.

Those tools can be reached from menu on the side. Birthday=Birthday diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 3e1ecea0be4..32b7d57e9b0 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -14,7 +14,7 @@ TasksDesc=This view presents all projects and tasks (your user permissions grant Myprojects=My projects ProjectsArea=Projects area NewProject=New project -AddProject=Add project +AddProject=Create project DeleteAProject=Delete a project DeleteATask=Delete a task ConfirmDeleteAProject=Are you sure you want to delete this project ? @@ -45,7 +45,7 @@ TaskDateStart=Task start date TaskDateEnd=Task end date TaskDescription=Task description NewTask=New task -AddTask=Add task +AddTask=Create task AddDuration=Add duration Activity=Activity Activities=Tasks/activities diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 8970d1eb2df..b10f0db3fd4 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -16,7 +16,7 @@ Prospect=Prospect ProspectList=Prospect list DeleteProp=Delete commercial proposal ValidateProp=Validate commercial proposal -AddProp=Add proposal +AddProp=Create proposal ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name %s ? LastPropals=Last %s proposals diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 502d328d7c3..fbc55081185 100755 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -10,7 +10,7 @@ NoResourceLinked=No resource linked ResourcePageIndex=Resources list ResourceSingular=Resource ResourceCard=Resource card -AddResource=Add a resource +AddResource=Create a resource ResourceFormLabel_ref=Resource name ResourceType=Resource type ResourceFormLabel_description=Resource description diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 50502c15c7e..ca3a81639bf 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -1,7 +1,7 @@ # Dolibarr language file - Source file is en_US - suppliers Suppliers=Suppliers Supplier=Supplier -AddSupplier=Add a supplier +AddSupplier=Create a supplier SupplierRemoved=Supplier removed SuppliersInvoice=Suppliers invoice NewSupplier=New supplier diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 1759ca8e174..64adbeb0dd6 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -4,7 +4,7 @@ Trips=Trips TripsAndExpenses=Trips and expenses TripsAndExpensesStatistics=Trips and expenses statistics TripCard=Trip card -AddTrip=Add trip +AddTrip=Create trip ListOfTrips=List of trips ListOfFees=List of fees NewTrip=New trip From f1e4f354710dc9aede47fa6382882cb401e1d491 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 13:09:18 +0200 Subject: [PATCH 36/98] Minor fixes on intervention sql No style on view for one day. --- htdocs/comm/action/index.php | 2 +- htdocs/fichinter/list.php | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2db6936e1d3..f29a6b66d37 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1028,7 +1028,7 @@ else // View by day $today=0; $todayarray=dol_getdate($now,'fast'); if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; - if ($today) $style='cal_today'; + //if ($today) $style='cal_today'; $timestamp=dol_mktime(12,0,0,$month,$day,$year); $arraytimestamp=dol_getdate($timestamp); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index b3858c5f4aa..076ad9bc689 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -49,7 +49,11 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="fd.date"; +if (! $sortfield) +{ + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sortfield="fd.date"; + else $sortfield="f.ref"; +} $limit = $conf->liste_limit; $search_ref=GETPOST('search_ref','alpha'); @@ -70,13 +74,12 @@ llxHeader('', $langs->trans("Intervention")); $sql = "SELECT"; $sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,"; -$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; +if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; $sql.= " s.nom as name, s.rowid as socid, s.client"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; -if (! $user->rights->societe->client->voir && empty($socid)) - $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; +if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; $sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " AND f.entity = ".$conf->entity; if ($search_ref) { @@ -86,7 +89,8 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } if ($search_desc) { - $sql .= natural_search(array('f.description', 'fd.description'), $search_desc); + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql .= natural_search(array('f.description', 'fd.description'), $search_desc); + else $sql .= natural_search(array('f.description'), $search_desc); } if ($search_status != '' && $search_status >= 0) { $sql .= ' AND f.fk_statut = '.$search_status; @@ -97,6 +101,7 @@ if ($socid) $sql.= " AND s.rowid = " . $socid; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); +//print $sql; $result=$db->query($sql); if ($result) From 5513a44a07e6b83001a0bdba7bfc7b0e1fe93811 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 14:17:52 +0200 Subject: [PATCH 37/98] Fix: translation. Use "template" instead of "pre-defined" --- htdocs/langs/en_US/bills.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 420a5eb44fb..177d82ef5b4 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -225,13 +225,13 @@ NonPercuRecuperable=Non-recoverable SetConditions=Set payment terms SetMode=Set payment mode Billed=Billed -RepeatableInvoice=Pre-defined invoice -RepeatableInvoices=Pre-defined invoices -Repeatable=Pre-defined -Repeatables=Pre-defined -ChangeIntoRepeatableInvoice=Convert into pre-defined -CreateRepeatableInvoice=Create pre-defined invoice -CreateFromRepeatableInvoice=Create from pre-defined invoice +RepeatableInvoice=Template invoice +RepeatableInvoices=Template invoices +Repeatable=Template +Repeatables=Templates +ChangeIntoRepeatableInvoice=Convert into template invoice +CreateRepeatableInvoice=Create template invoice +CreateFromRepeatableInvoice=Create from template invoice CustomersInvoicesAndInvoiceLines=Customer invoices and invoice's lines CustomersInvoicesAndPayments=Customer invoices and payments ExportDataset_invoice_1=Customer invoices list and invoice's lines From 8581e953f9c91ac0f0b75b80067ec209abe02e9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 14:45:12 +0200 Subject: [PATCH 38/98] Doxygen --- htdocs/core/class/commonobject.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3da33709165..9996337736a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1747,6 +1747,7 @@ abstract class CommonObject * @param string $origin Linked element type * @param int $origin_id Linked element id * @return int <=0 if KO, >0 if OK + * @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked */ function add_object_linked($origin=null, $origin_id=null) { @@ -1790,6 +1791,7 @@ abstract class CommonObject * @param string $targettype Object target type * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided * @return void + * @see add_object_linked, updateObjectLinked, deleteObjectLinked */ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') { @@ -1819,6 +1821,12 @@ abstract class CommonObject $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element); $targettype = (! empty($targettype) ? $targettype : $this->element); + if (empty($sourceid) && empty($targetid)) + { + dol_print_error('','Bad usage of function. No parameter defined and no id defined'); + return -1; + } + // Links beetween objects are stored in this table $sql = 'SELECT fk_source, sourcetype, fk_target, targettype'; $sql.= ' FROM '.MAIN_DB_PREFIX.'element_element'; @@ -1944,6 +1952,7 @@ abstract class CommonObject * @param int $targetid Object target id * @param string $targettype Object target type * @return int >0 if OK, <0 if KO + * @see add_object_linked, fetObjectLinked, deleteObjectLinked */ function updateObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') { @@ -1989,6 +1998,7 @@ abstract class CommonObject * @param int $targetid Object target id * @param string $targettype Object target type * @return int >0 if OK, <0 if KO + * @see add_object_linked, updateObjectLinked, fetchObjectLinked */ function deleteObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') { From fb04b1aedbb8f2703a2b9a6e71f1c2f0f9280998 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 14:47:17 +0200 Subject: [PATCH 39/98] More spaced cells --- htdocs/theme/eldy/style.css.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 34a653b61ea..66de6a9be12 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1325,7 +1325,8 @@ div.tabs { /* margin: 0px 0px 2px 6px; padding: 0px 6px 3px 0px; */ text-align: ; - margin-left: 4px !important; + margin-left: 6px !important; + margin-right: 6px !important; clear:both; height:100%; } @@ -1655,7 +1656,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord } table.border td, div.border div div.tagtd { - padding: 1px 2px 1px 2px; + padding: 2px 2px 2px 2px; border: 1px solid #D0D0D0; border-collapse: collapse; } From 4b34455f0a4f3dc41832e20d75739dc4f6f1b33c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 15:01:56 +0200 Subject: [PATCH 40/98] Fix permissions --- htdocs/commande/card.php | 4 +-- htdocs/contact/card.php | 4 +-- htdocs/core/lib/company.lib.php | 36 ++++++++++++------------ htdocs/projet/tasks/time.php | 50 ++++++++++++++++----------------- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 136ade4df3c..a7ced339087 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -629,8 +629,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) { } } else - { - setEventMessage($prodcustprice->error,'errors'); + { + setEventMessage($prodcustprice->error,'errors'); } } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1ba775268a1..db83554c7ae 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -243,12 +243,12 @@ if (empty($reshook)) { if ($backtopage) { - header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } else { - header("Location: ".DOL_URL_ROOT.'/contact/list.php'); + header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7236d411c22..1ff61f96c83 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -110,24 +110,24 @@ function societe_prepare_head($object) if (! empty($conf->notification->enabled)) { $nbNote = 0; - $sql = "SELECT COUNT(n.rowid) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; - $sql.= " WHERE fk_soc = ".$object->id; - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $nbNote=$obj->nb; - $i++; - } - } - else { - dol_print_error($db); - } + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; + $sql.= " WHERE fk_soc = ".$object->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $nbNote=$obj->nb; + $i++; + } + } + else { + dol_print_error($db); + } $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 13b1e48f477..676b17a5951 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -292,37 +292,37 @@ if ($id > 0 || ! empty($ref)) // Label print ''.$langs->trans("Label").''.$object->label.''; - // Date start - print ''.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'dayhour'); - print ''; - - // Date end - print ''.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'dayhour'); - print ''; - - // Planned workload - print ''.$langs->trans("PlannedWorkload").''; - print convertSecondToTime($object->planned_workload,'allhourmin'); - print ''; - - // Progress declared - print ''.$langs->trans("ProgressDeclared").''; - print $object->progress.' %'; - print ''; - - // Progress calculated + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'dayhour'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'dayhour'); + print ''; + + // Planned workload + print ''.$langs->trans("PlannedWorkload").''; + print convertSecondToTime($object->planned_workload,'allhourmin'); + print ''; + + // Progress declared + print ''.$langs->trans("ProgressDeclared").''; + print $object->progress.' %'; + print ''; + + // Progress calculated print ''.$langs->trans("ProgressCalculated").''; if ($object->planned_workload) { - $tmparray=$object->getSummaryOfTimeSpent(); + $tmparray=$object->getSummaryOfTimeSpent(); if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %'; else print '0 %'; } - else print ''; - print ''; - + else print ''; + print ''; + // Project if (empty($withproject)) { From a99bd1c83530984a81f97f89951638d884e32183 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 15:30:38 +0200 Subject: [PATCH 41/98] Fix: Fix permission on files. --- dev/fixperms.sh | 2 ++ htdocs/holiday/admin/tomergewithholiday.php | 0 htdocs/holiday/tomergewithdefine_holiday.php | 0 htdocs/resource/add.php | 0 htdocs/resource/card.php | 0 scripts/accountancy/export-thirdpartyaccount.php | 0 6 files changed, 2 insertions(+) mode change 100755 => 100644 htdocs/holiday/admin/tomergewithholiday.php mode change 100755 => 100644 htdocs/holiday/tomergewithdefine_holiday.php mode change 100755 => 100644 htdocs/resource/add.php mode change 100755 => 100644 htdocs/resource/card.php mode change 100644 => 100755 scripts/accountancy/export-thirdpartyaccount.php diff --git a/dev/fixperms.sh b/dev/fixperms.sh index 731e45cf703..5844e8b2916 100755 --- a/dev/fixperms.sh +++ b/dev/fixperms.sh @@ -25,4 +25,6 @@ then find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; chmod a+x ./scripts/*/*.php chmod a+x ./scripts/*/*.sh + chmod g-w ./scripts/*/*.php + chmod g-w ./scripts/*/*.sh fi diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php old mode 100755 new mode 100644 diff --git a/htdocs/holiday/tomergewithdefine_holiday.php b/htdocs/holiday/tomergewithdefine_holiday.php old mode 100755 new mode 100644 diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php old mode 100755 new mode 100644 diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php old mode 100755 new mode 100644 diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php old mode 100644 new mode 100755 From e2afa48caa0373e39ac51c12fb5b14e8a1fe3fd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2014 16:23:32 +0200 Subject: [PATCH 42/98] Fix: avoid warning --- htdocs/core/lib/admin.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 39813b9e191..075baf41161 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -965,6 +965,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql { //var_dump($objMod->dictionaries['tabname']); $taborder[] = 0; + $tabfieldcheck[] = array(); $tabhelp[] = array(); foreach($objMod->dictionaries['tabname'] as $val) { $taborder[] = count($tabname)+1; @@ -978,7 +979,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val; foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val; foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val; - foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; + if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val; //foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val; //$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']); From 8095bbf809e0635d4819b8e47c6d8b3ae8410b93 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 17 Oct 2014 17:10:12 +0200 Subject: [PATCH 43/98] Update functions2.lib.php --- htdocs/core/lib/functions2.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 4b206f852fc..a2420624695 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -785,7 +785,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - if ($bEntityOn) // only if entity enable + if ($bentityon) // only if entity enable $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -826,7 +826,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; - $sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bentityon) // only if entity enable + $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; @@ -879,7 +880,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table; //$sql.= " WHERE ".$field." not like '(%'"; $maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'"; - $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($bentityon) // only if entity enable + $maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; From 5dbdb50cd78b61bc28a30ce26aa564e29abd83aa Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 17 Oct 2014 20:35:49 +0200 Subject: [PATCH 44/98] Trad: Syncro es_ES from Transifex --- htdocs/langs/es_ES/main.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index d92caea7ab2..a9f20e07d72 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -266,6 +266,7 @@ Afternoon=Tarde Quadri=Trimestre MonthOfDay=Mes del día HourShort=H +MinuteShort=min Rate=Tipo UseLocalTax=Incluir tasas Bytes=Bytes @@ -679,7 +680,7 @@ ViewPrivateNote=Ver notas XMoreLines=%s línea(s) ocultas PublicUrl=URL pública AddBox=Añadir caja - +SelectElementAndClickRefresh=Seleccione un elemento y haga clic en Refrescar # Week day Monday=Lunes Tuesday=Martes From a2d23fd69991fc774e2902a409cbd2bf2d0fe55e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 00:33:30 +0200 Subject: [PATCH 45/98] Fix: Error management of hook was duplicating errors. --- htdocs/core/class/hookmanager.class.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 4f7044e3d1f..298c36636bd 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -161,29 +161,29 @@ class HookManager { //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."
\n"; - //print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action; - // jump to next class if method does not exists + // jump to next module/class if method does not exists if (! method_exists($actionclassinstance,$method)) continue; - // test to avoid to run twice a hook, when a module implements several active contexts + + // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method for avoid to run twice + + // Clean class (an error may have been set into a previous call of another method for same module/hook) + $actionclassinstance->error=0; + $actionclassinstance->errors=array(); + // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { + dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { $error++; $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - // TODO dead code to remove (do not enable this, but fix hook instead) - /* Change must be inside the method of hook if required. Only hook must decide if $action must be modified or not. - if ($method == 'doActions') - { - if ($action=='add') $action='create'; - if ($action=='update') $action='edit'; - }*/ + dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error)?'':" ".$this->error).(empty($this->errors)?'':" ".join(",",$this->errors)), LOG_ERR); } if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); @@ -195,6 +195,7 @@ class HookManager // TODO. this should be done into the method of hook by returning nothing if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + //dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); From f49f9e24b766a3f046bd7046ced3107e4af25671 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 00:34:08 +0200 Subject: [PATCH 46/98] Removed useless log and removed REQUEST. --- htdocs/societe/soc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index e9e79d52130..3dc6ea95900 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -446,7 +446,6 @@ if (empty($reshook)) $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($object)."::delete", LOG_DEBUG); if (! $object->db->query($sql)) { $error++; @@ -528,7 +527,7 @@ if (empty($reshook)) // Define output language $outputlangs = $langs; $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; if (! empty($newlang)) { From dbbf31d87b92c11d0db36c1184a93d9893d37b14 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 00:41:21 +0200 Subject: [PATCH 47/98] Fix: Restore comaptibility with all languages. Fix: Corrupting data function. --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/societe/soc.php | 130 +++++++++++++++--------------- 2 files changed, 66 insertions(+), 66 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19c5ce79c82..4be2583aa63 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -170,7 +170,7 @@ function dol_shutdown() * Return value of a param into GET or POST supervariable * * @param string $paramname Name of parameter to found - * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) + * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to custom diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 3dc6ea95900..a0b9bda1c8e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -136,48 +136,48 @@ if (empty($reshook)) { $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha')); + $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha')); $object->civility_id = GETPOST('civility_id', 'int'); // Add non official properties - $object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha'); - $object->firstname = GETPOST('firstname','san_alpha'); + $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha'); + $object->firstname = GETPOST('firstname','alpha'); } else { - $object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha'); + $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha'); } - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id', 'int'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax','san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax','alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); - $object->code_client = GETPOST('code_client', 'san_alpha'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->capital = GETPOST('capital', 'san_alpha'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->capital = GETPOST('capital', 'alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); - $object->tva_assuj = GETPOST('assujtva_value', 'san_alpha'); - $object->status = GETPOST('status', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); + $object->tva_assuj = GETPOST('assujtva_value', 'alpha'); + $object->status = GETPOST('status', 'alpha'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha'); - $object->localtax1_value = GETPOST('lt1', 'san_alpha'); - $object->localtax2_value = GETPOST('lt2', 'san_alpha'); + $object->localtax1_value = GETPOST('lt1', 'alpha'); + $object->localtax2_value = GETPOST('lt2', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); @@ -637,31 +637,31 @@ else if (GETPOST("type")=='p') { $object->client=2; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } - $object->name = GETPOST('nom', 'san_alpha'); - $object->firstname = GETPOST('firstname', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); $object->client = GETPOST('client')?GETPOST('client'):$object->client; - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); $object->civility_id = GETPOST('civility_id', 'int'); @@ -676,7 +676,7 @@ else $object->localtax1_value =GETPOST('lt1', 'int'); $object->localtax2_value =GETPOST('lt2', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); @@ -1146,37 +1146,37 @@ else if (GETPOST('nom')) { // We overwrite with values if posted - $object->name = GETPOST('nom', 'san_alpha'); - $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); + $object->name = GETPOST('nom', 'alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->client = GETPOST('client', 'int'); - $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'alpha'); $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); - $object->address = GETPOST('address', 'san_alpha'); - $object->zip = GETPOST('zipcode', 'san_alpha'); - $object->town = GETPOST('town', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->address = GETPOST('address', 'alpha'); + $object->zip = GETPOST('zipcode', 'alpha'); + $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id; $object->state_id = GETPOST('state_id', 'int'); - $object->skype = GETPOST('skype', 'san_alpha'); - $object->phone = GETPOST('phone', 'san_alpha'); - $object->fax = GETPOST('fax', 'san_alpha'); + $object->skype = GETPOST('skype', 'alpha'); + $object->phone = GETPOST('phone', 'alpha'); + $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->capital = GETPOST('capital', 'int'); - $object->idprof1 = GETPOST('idprof1', 'san_alpha'); - $object->idprof2 = GETPOST('idprof2', 'san_alpha'); - $object->idprof3 = GETPOST('idprof3', 'san_alpha'); - $object->idprof4 = GETPOST('idprof4', 'san_alpha'); - $object->idprof5 = GETPOST('idprof5', 'san_alpha'); - $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'alpha'); + $object->idprof2 = GETPOST('idprof2', 'alpha'); + $object->idprof3 = GETPOST('idprof3', 'alpha'); + $object->idprof4 = GETPOST('idprof4', 'alpha'); + $object->idprof5 = GETPOST('idprof5', 'alpha'); + $object->idprof6 = GETPOST('idprof6', 'alpha'); $object->typent_id = GETPOST('typent_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int'); - $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'alpha'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); - $object->default_lang = GETPOST('default_lang', 'san_alpha'); + $object->default_lang = GETPOST('default_lang', 'alpha'); $object->tva_assuj = GETPOST('assujtva_value', 'int'); - $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->status = GETPOST('status', 'int'); //Local Taxes From 58b15fa73678605d8c2a55161ea8a18eae3a6ff7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 01:32:38 +0200 Subject: [PATCH 48/98] Fix: Solve some regressions --- htdocs/admin/dict.php | 15 +++++--- htdocs/core/class/html.formcompany.class.php | 9 ++--- htdocs/core/lib/company.lib.php | 2 +- htdocs/societe/societecontact.php | 40 ++++++++++---------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7a84470b320..51f0f4df8b9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -387,13 +387,14 @@ if ($id == 11) $langs->load("bills"); $langs->load("interventions"); $elementList = array( - 'proposal' => $langs->trans('Proposal'), - 'order' => $langs->trans('Order'), - 'invoice' => $langs->trans('Bill'), + '' => '', +// 'proposal' => $langs->trans('Proposal'), +// 'order' => $langs->trans('Order'), +// 'invoice' => $langs->trans('Bill'), 'invoice_supplier' => $langs->trans('SupplierBill'), 'order_supplier' => $langs->trans('SupplierOrder'), - 'intervention' => $langs->trans('InterventionCard'), - 'contract' => $langs->trans('Contract'), +// 'intervention' => $langs->trans('InterventionCard'), +// 'contract' => $langs->trans('Contract'), 'project' => $langs->trans('Project'), 'project_task' => $langs->trans('Task'), 'agenda' => $langs->trans('Agenda'), @@ -402,10 +403,11 @@ if ($id == 11) 'propal' => $langs->trans('Proposal'), 'commande' => $langs->trans('Order'), 'facture' => $langs->trans('Bill'), - 'facture_fourn' => $langs->trans('SupplierBill'), +// 'facture_fourn' => $langs->trans('SupplierBill'), 'fichinter' => $langs->trans('InterventionCard') ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); + asort($elementList); $sourceList = array( 'internal' => $langs->trans('Internal'), 'external' => $langs->trans('External') @@ -709,6 +711,7 @@ if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); } +//var_dump($elementList); /* * Show a dictionary diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ef58b6c7322..d32c0def5ab 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -682,22 +682,21 @@ class FormCompany * @param string $selected Default selected value * @param string $htmlname HTML select name * @param string $source Source ('internal' or 'external') - * @param string $order Sort criteria + * @param string $sortorder Sort criteria * @param int $showempty 1=Add en empty line * @return void */ - function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $order='code', $showempty=0) + function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $sortorder='code', $showempty=0) { if (is_object($object) && method_exists($object, 'liste_type_contact')) { - $lesTypes = $object->liste_type_contact($source, $order, 0, 1); + $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); print '\n"; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 1ff61f96c83..e5723b9e2d6 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -67,7 +67,7 @@ function societe_prepare_head($object) if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; - $head[$h][1] = $langs->trans("Contact"); + $head[$h][1] = $langs->trans("ContactsAddresses"); $head[$h][2] = 'contact'; $h++; } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 9e82e1a052f..7a2274e81b5 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $langs->load("orders"); $langs->load("companies"); -$id=GETPOST('id','int'); +$id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); $ref=GETPOST('ref','alpha'); $action=GETPOST('action','alpha'); @@ -44,8 +44,9 @@ $result = restrictedArea($user, 'societe', $id,''); $object = new Societe($db); + /* - * Ajout d'un nouveau contact + * Actions */ if ($action == 'addcontact' && $user->rights->societe->creer) @@ -133,12 +134,9 @@ $userstatic=new User($db); /* Mode vue et edition */ /* */ /* *************************************************************************** */ -dol_htmloutput_mesg($mesg); if ($id > 0 || ! empty($ref)) { - $langs->trans("OrderCard"); - if ($object->fetch($id, $ref) > 0) { $soc = new Societe($db); @@ -154,12 +152,12 @@ if ($id > 0 || ! empty($ref)) print ''; print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom'); print ''; - + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''.$langs->trans('Prefix').''.$object->prefix_comm.''; } - + if ($object->client) { print ''; @@ -168,7 +166,7 @@ if ($id > 0 || ! empty($ref)) if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; print ''; } - + if ($object->fournisseur) { print ''; @@ -216,7 +214,7 @@ if ($id > 0 || ! empty($ref)) { $titre=$langs->trans("MembersListOfTiers"); print '
'; - + print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,''); print ""; @@ -230,13 +228,13 @@ if ($id > 0 || ! empty($ref)) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print "\n"; - + $var=True; $i=0; while ($i < $num && $i < $conf->liste_limit) { $objp = $db->fetch_object($resql); - + $datefin=$db->jdate($objp->datefin); $memberstatic->id=$objp->rowid; $memberstatic->ref=$objp->rowid; @@ -244,43 +242,43 @@ if ($id > 0 || ! empty($ref)) $memberstatic->firstname=$objp->firstname; $companyname=$objp->company; - + $var=!$var; print ""; - + // Ref print "\n"; - + // Lastname print "\n"; - + // Login print "\n"; - + // Type $membertypestatic->id=$objp->type_id; $membertypestatic->libelle=$objp->type; print ''; - + // Moral/Physique print "\n"; - + // EMail print "\n"; - + // Statut print '"; - + // End of subscription date if ($datefin) { @@ -303,7 +301,7 @@ if ($id > 0 || ! empty($ref)) } print ''; } - + print "\n"; $i++; } From b43d96f86c8244d9c4db66f370512fc42c3d3061 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 02:12:10 +0200 Subject: [PATCH 49/98] New: Add id into select_category method. --- htdocs/core/class/html.form.class.php | 1 + htdocs/core/class/html.formother.class.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b26147918ca..bf81c3031a4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2703,6 +2703,7 @@ class Form * @param int $maxlength Maximum length for labels * @param int $excludeafterid Exclude all categories after this leaf in category tree. * @return void + * @see select_categories */ function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7abe08729d2..1ed76cddd9b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -307,6 +307,7 @@ class FormOther * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" * @return string Html combo list code + * @see select_all_categories */ function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0) { @@ -318,7 +319,7 @@ class FormOther $tab_categs = $static_categs->get_full_arbo($type); // Print a select with each of them - $moreforfilter =''; $moreforfilter.=''; // Should use -1 to say nothing if (is_array($tab_categs)) From 14ea66f3b716753370d5e71b4545661508772199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 02:31:48 +0200 Subject: [PATCH 50/98] Legend --- htdocs/comm/action/peruser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 51ddb81c0b4..dacc7c5ce00 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -710,6 +710,11 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '
 
'; print $langs->trans("Other"); print '
'; + /* TODO Show this if at least one cumulated event + print '
 
'; + print $langs->trans("SeveralEvents"); + print '
'; + */ } // Add js code to manage click on a box @@ -734,7 +739,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday; + url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ From 90d47cffae315f235aadb77373f8e0aaa553de6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 14:56:06 +0200 Subject: [PATCH 51/98] Better error management and better error message for reporting upload or error of images. --- htdocs/admin/company.php | 25 ++++++++++-------- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/en_US/main.lang | 4 +-- htdocs/langs/en_US/propal.lang | 2 -- htdocs/product/class/product.class.php | 36 +++++++++++++++----------- htdocs/product/photos.php | 16 +++++++++++- htdocs/theme/eldy/style.css.php | 8 +++--- 7 files changed, 58 insertions(+), 35 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index c774faf5caa..96dff7755af 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -117,7 +117,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } else dol_syslog($imgThumbMini); } - else dol_syslog($langs->trans("ErrorImageFormatNotSupported"),LOG_WARNING); + else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); } else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) { @@ -133,9 +133,10 @@ if ( ($action == 'update' && empty($_POST["cancel"])) } } else - { + { $error++; - setEventMessage($langs->trans("ErrorOnlyPngJpgSupported"),'errors'); + $langs->load("errors"); + setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); } } } @@ -158,7 +159,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) // Local taxes dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity); - + if($_POST["optionlocaltax1"]=="localtax1on") { if(!isset($_REQUEST['lt1'])) @@ -226,13 +227,15 @@ if ($action == 'addthumb') else { $error++; - setEventMessage($langs->trans("ErrorImageFormatNotSupported"),'errors'); - dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING); + $langs->load("errors"); + setEventMessage($langs->trans("ErrorBadImageFormat"),'errors'); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); } } else { $error++; + $langs->load("errors"); setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors'); dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); } @@ -601,7 +604,7 @@ if ($action == 'edit' || $action == 'updateedit') $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); } print ''; - + print '
'; - } + } print ''; print "
"; print $memberstatic->getNomUrl(1); print "rowid\">"; print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); print "".$objp->login."'; print $membertypestatic->getNomUrl(1,32); print '".$memberstatic->getmorphylib($objp->morphy)."".dol_print_email($objp->email,0,0,1)."'; print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print "
'.$langs->trans("CalcLocaltax").': '; $opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code)); print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); @@ -1003,7 +1006,7 @@ else if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) { print '
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'.$langs->trans("CalcLocaltax").': '; if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0) { @@ -1016,7 +1019,7 @@ else else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); } - + print '
"; print "\n"; @@ -1054,7 +1057,7 @@ else if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) { print ''.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .''; - } + } print ''.$langs->trans("CalcLocaltax").': '; if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0) { @@ -1068,7 +1071,7 @@ else { print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); } - + print ''; print ""; print "\n"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ed8354b9e8d..a2757bf5332 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -37,7 +37,7 @@ ErrorSupplierCodeRequired=Supplier code required ErrorSupplierCodeAlreadyUsed=Supplier code already used ErrorBadParameters=Bad parameters ErrorBadValueForParameter=Wrong value '%s' for parameter incorrect '%s' -ErrorBadImageFormat=Image file has not a supported format +ErrorBadImageFormat=Image file has not a supported format (Your PHP does not support functions to convert images of this format) ErrorBadDateFormat=Value '%s' has wrong date format ErrorWrongDate=Date is not correct! ErrorFailedToWriteInDir=Failed to write in directory %s diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fd2a7d94c76..bc59c200f49 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -58,12 +58,12 @@ ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'. ErrorNoSocialContributionForSellerCountry=Error, no social contribution type defined for country '%s'. ErrorFailedToSaveFile=Error, failed to save file. -ErrorOnlyPngJpgSupported=Error, only .png and .jpg image format file are supported. -ErrorImageFormatNotSupported=Your PHP does not support functions to convert images of this format. SetDate=Set date SelectDate=Select a date SeeAlso=See also %s BackgroundColorByDefault=Default background color +FileNotUploaded=The file was not uploaded +FileUploaded=The file was successfully uploaded FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. Click on "Attach file" for this. NbOfEntries=Nb of entries GoToWikiHelpPage=Read online help (need Internet access) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index b10f0db3fd4..2b6d12870a1 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -55,8 +55,6 @@ NoOpenedPropals=No opened commercial proposals NoOtherOpenedPropals=No other opened commercial proposals RefProposal=Commercial proposal ref SendPropalByMail=Send commercial proposal by mail -FileNotUploaded=The file was not uploaded -FileUploaded=The file was successfully uploaded AssociatedDocuments=Documents associated with the proposal: ErrorCantOpenDir=Can't open directory DatePropal=Date of proposal diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index fa959b38277..226a3501652 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -46,6 +46,8 @@ class Product extends CommonObject protected $isnolinkedbythird = 1; // No field fk_soc protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff'; + //! Identifiant unique var $id ; //! Ref @@ -1479,7 +1481,7 @@ class Product extends CommonObject $this->date_modification = $obj->tms; $this->import_key = $obj->import_key; $this->entity = $obj->entity; - + $this->ref_ext = $obj->ref_ext; $this->db->free($resql); @@ -3068,18 +3070,19 @@ class Product extends CommonObject } /** - * Deplace fichier uploade sous le nom $files dans le repertoire sdir + * Move an uploaded file described into $file array into target directory $sdir. * - * @param string $sdir Repertoire destination finale - * @param string $file Nom du fichier uploade - * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut) - * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) - * @return void + * @param string $sdir Target directory + * @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...) + * @param int $maxWidth Largeur maximum que dois faire la miniature (160 by defaut) + * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 by defaut) + * @return int <0 if KO, >0 if OK */ function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $result = 0; $dir = $sdir .'/'. get_exdir($this->id,2) . $this->id ."/photos"; dol_mkdir($dir); @@ -3098,6 +3101,9 @@ class Product extends CommonObject $this->add_thumb($originImage,$maxWidth,$maxHeight); } } + + if (is_numeric($result) && $result > 0) return 1; + else return -1; } /** @@ -3192,7 +3198,7 @@ class Product extends CommonObject if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) + if (dol_is_file($dir.$file) && preg_match('/('.$this->regeximgext.')$/i', $dir.$file)) { $nbphoto++; $photo = $file; @@ -3227,11 +3233,11 @@ class Product extends CommonObject $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; if ($photo_vignette && $imgarray['height'] > $maxHeight) { $return.= ''; - $return.= ''; + $return.= ''; } else { $return.= ''; - $return.= ''; + $return.= ''; } $return.= ''."\n"; @@ -3241,7 +3247,7 @@ class Product extends CommonObject { $return.= '
'; // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) + if ($photo_vignette && preg_match('/('.$this->regeximgext.')$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) { $return.= ''.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; } @@ -3266,7 +3272,7 @@ class Product extends CommonObject } if ($size == 0) { // Format origine - $return.= ''; + $return.= ''; if ($showfilename) $return.= '
'.$viewfilename; if ($showaction) @@ -3334,14 +3340,14 @@ class Product extends CommonObject while (($file = readdir($handle)) != false) { if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO - if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) + if (dol_is_file($dir.$file) && preg_match('/('.$this->regeximgext.')$/i', $dir.$file)) { $nbphoto++; // On determine nom du fichier vignette $photo=$file; $photo_vignette=''; - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) + if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs)) { $photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0]; } @@ -3385,7 +3391,7 @@ class Product extends CommonObject dol_delete_file($file); // Si elle existe, on efface la vignette - if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs)) + if (preg_match('/('.$this->regeximgext.')$/i',$filename,$regs)) { $photo_vignette=preg_replace('/'.$regs[0].'/i','',$filename).'_small'.$regs[0]; if (file_exists(dol_osencode($dirthumb.$photo_vignette))) diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 09f03b15437..0ae65a7dec6 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -26,6 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -59,7 +60,20 @@ if ($id > 0 || ! empty($ref)) if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - if ($object->id) $result = $object->add_photo($dir, $_FILES['userfile']); + if ($object->id) + { + if (image_format_supported($_FILES['userfile']['name']) >= 1) + { + $result = $object->add_photo($dir, $_FILES['userfile']); + if ($result > 0) setEventMessage($langs->trans("FileUploaded")); + else setEventMessage($langs->trans("FileNotUploaded"), 'errors'); + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorBadImageFormat"), 'errors'); + } + } } if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && ($user->rights->produit->creer || $user->rights->service->creer)) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 66de6a9be12..657d48f32d3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2120,9 +2120,11 @@ div.dolgraph div.legend, div.dolgraph div.legend div { background-color: rgba(25 div.dolgraph div.legend table tbody tr { height: auto; } .photo { -border: 0px; -/* filter:alpha(opacity=55); */ -/* opacity:.55; */ + border: 0px; +} +.photowithmargin { + margin-bottom: 2px; + margin-top: 2px; } .logo_setup From 889dbec97b12f813a54af41902d1a11aa7f82fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 15:07:38 +0200 Subject: [PATCH 52/98] Use javascript On/Off tosell-tobuy if enabled --- htdocs/product/stock/product.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index a2096c49f14..ae8afe696bc 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -276,15 +276,23 @@ if ($id > 0 || $ref) print ''.$langs->trans("Label").''.$product->libelle.''; print ''; - // Status (to sell) - print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - print $product->getLibStatut(2,0); - print ''; + // Status (to sell) + print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($product->id, 'status'); + } else { + print $product->getLibStatut(2,0); + } + print ''; - // Status (to buy) - print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - print $product->getLibStatut(2,1); - print ''; + // Status (to buy) + print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_productonoff($product->id, 'status_buy'); + } else { + print $product->getLibStatut(2,1); + } + print ''; if ($conf->productbatch->enabled) { print ''.$langs->trans("Status").' ('.$langs->trans("l_sellby").')'; From 6bbeaee8fe49030c48127b8ce3bdbcf4da5ec130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 15:35:32 +0200 Subject: [PATCH 53/98] Fix: Selection of users color was not user owner of event. --- ChangeLog | 1 + htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/comm/action/index.php | 32 +++++++++++++++---- htdocs/comm/action/listactions.php | 6 ++-- htdocs/user/card.php | 19 ++++++----- 5 files changed, 40 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e48a5fc67d..eb781d4ee4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Can set a color on user card (visible into agenda view). - New: extrafields for projects and tasks are exported to ODT documents. - New: Add number of active notification into tab title (like we do for notes and documents) - New: Can add product into category from category card. diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index df0a359dd56..b631160afde 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -66,7 +66,7 @@ class ActionComm extends CommonObject var $note; // Description var $userassigned = array(); // Array of user ids - var $userownerid; // Id of user owner + var $userownerid; // Id of user owner var $userdoneid; // Id of user done var $usertodo; // Object user of owner // deprecated var $userdone; // Object user that did action // deprecated diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 48387245c8a..2098a07d20b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -876,6 +876,7 @@ if (count($listofextcals)) $maxnbofchar=18; $cachethirdparties=array(); $cachecontacts=array(); +$cacheusers=array(); // Define theme_datacolor array $color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php"; @@ -1074,7 +1075,7 @@ $db->close(); * @param int $year Year * @param int $monthshown Current month shown in calendar view * @param string $style Style to use for this day - * @param array $eventarray Array of events + * @param array $eventarray Array of events * @param int $maxprint Nb of actions to show each day on month view (0 means no limit) * @param int $maxnbofchar Nb of characters to show for event line * @param string $newparam Parameters on current URL @@ -1087,7 +1088,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $user, $conf, $langs; global $action, $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form global $theme_datacolor; - global $cachethirdparties, $cachecontacts, $colorindexused; + global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused; print '

'."\n"; @@ -1146,11 +1147,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (in_array($user->id, $keysofuserassigned)) { $nummytasks++; $cssclass='family_mytasks'; - - // Must defined rule to choose color of who to use. - // event->ownerid will still contains user id of owner - // event->userassigned will be an array in future. - $color=$user->color; + + if (empty($cacheusers[$event->userownerid])) + { + $newuser=new User($db); + $newuser->fetch($event->userownerid); + $cacheusers[$event->userownerid]=$newuser; + } + //var_dump($cacheusers[$event->userownerid]->color); + + // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) + if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; } else if ($event->type_code == 'ICALEVENT') { @@ -1171,6 +1178,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa else { $numother++; $cssclass='family_other'; + + if (empty($cacheusers[$event->userownerid])) + { + $newuser=new User($db); + $newuser->fetch($event->userownerid); + $cacheusers[$event->userownerid]=$newuser; + } + //var_dump($cacheusers[$event->userownerid]->color); + + // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) + if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; } if ($color == -1) // Color was not forced. Set color according to color index. { diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 046ec450c26..4fc7386157b 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -259,7 +259,7 @@ if ($resql) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"ut.login",$param,"","",$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DoneBy"),$_SERVER["PHP_SELF"],"ud.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield,$sortorder); @@ -275,7 +275,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + //print ''; print ''; print ''; //print '  '; @@ -348,6 +348,7 @@ if ($resql) print ''; // User author + /* print ''; if ($obj->useridauthor) { @@ -358,6 +359,7 @@ if ($resql) } else print ' '; print ''; + */ // User to do print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 4e17875f1ed..4760f73f855 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -206,7 +206,7 @@ if ($action == 'add' && $canadduser) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; - + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form @@ -353,7 +353,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; - + $object->color = GETPOST("color")!=''?GETPOST("color"):''; // Fill array 'array_options' with data from add form @@ -980,7 +980,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; print ''; print "\n"; - + // User color if (! empty($conf->agenda->enabled)) { @@ -1124,7 +1124,7 @@ else if ($action != 'edit') { $rowspan=17; - + print ''; // Ref @@ -1325,15 +1325,14 @@ else print ''; print ''; } - + // Color user if (! empty($conf->agenda->enabled)) { print ''; - print ''; - print ''; print "\n"; } @@ -1662,7 +1661,7 @@ else if (! empty($conf->skype->enabled)) $rowspan++; if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3; if (! empty($conf->agenda->enabled)) $rowspan++; - + print ''; print ''; print ''; @@ -2039,7 +2038,7 @@ else print ''; print ""; } - + // User color if (! empty($conf->agenda->enabled)) { From 873f8a6f27622f9677f82418b9d75976cc850054 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 15:53:42 +0200 Subject: [PATCH 54/98] If there is at least one favorite into countries, then add a separator into list to show limit between sorted entries and not sorted entries. --- htdocs/core/class/html.form.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6dfc78c216c..9985bcc0e81 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -480,6 +480,7 @@ class Form $countryArray=array(); $favorite=array(); $label=array(); + $atleastonefavorite=0; $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country"; @@ -504,6 +505,7 @@ class Form $countryArray[$i]['code_iso'] = $obj->code_iso; $countryArray[$i]['code_iso3'] = $obj->code_iso3; $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:'')); + $countryArray[$i]['favorite'] = $obj->favorite; $favorite[$i] = $obj->favorite; $label[$i] = dol_string_unaccent($countryArray[$i]['label']); $i++; @@ -513,7 +515,12 @@ class Form foreach ($countryArray as $row) { - //print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].'
'; + if ($row['favorite'] && $row['code_iso']) $atleastonefavorite++; + if (empty($row['favorite']) && $atleastonefavorite) + { + $atleastonefavorite=0; + $out.= ''; + } if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']) ) { $foundselected=true; From 13590a876b3d9b117ae47f91b1048be103b544f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 16:08:15 +0200 Subject: [PATCH 55/98] Fix: A little clean of dol_hash usage. --- htdocs/core/class/CMailFile.class.php | 6 +++--- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/rssparser.class.php | 2 +- htdocs/core/class/smtps.class.php | 10 +++++----- htdocs/core/lib/security.lib.php | 11 +++++++---- htdocs/core/lib/security2.lib.php | 2 +- htdocs/user/class/user.class.php | 4 ++-- htdocs/user/passwordforgotten.php | 6 +++--- test/phpunit/SecurityTest.php | 2 +- 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index a289b43c4a9..5288dc635cb 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -118,10 +118,10 @@ class CMailFile $this->mixed_boundary = "multipart_x." . time() . ".x_boundary"; // On defini related_boundary - $this->related_boundary = 'mul_'.dol_hash(uniqid("dolibarr2")); + $this->related_boundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3); // Force md5 hash (does not contains special chars) // On defini alternative_boundary - $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3")); + $this->alternative_boundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); // Force md5 hash (does not contains special chars) // If ending method not defined if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail'; @@ -971,7 +971,7 @@ class CMailFile } // cid - $this->html_images[$i]["cid"] = dol_hash(uniqid(time())); + $this->html_images[$i]["cid"] = dol_hash(uniqid(time()), 3); // Force md5 hash (does not contains special chars) $this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html); } $i++; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9985bcc0e81..f41aaa5d19e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4401,7 +4401,7 @@ class Form { global $dolibarr_main_url_root; $ret.=''; - $ret.='Photo found on Gravatar'; + $ret.='Photo found on Gravatar'; // gravatar need md5 hash } else { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index d9a7d8348d6..5a156b1eda7 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -194,7 +194,7 @@ class RssParser } $this->_urlRSS = $urlRSS; - $newpathofdestfile=$cachedir.'/'.dol_hash($this->_urlRSS); + $newpathofdestfile=$cachedir.'/'.dol_hash($this->_urlRSS,3); // Force md5 hash (does not contains special chars) $newmask='0644'; //dol_syslog("RssPArser::parser parse url=".$urlRSS." => cache file=".$newpathofdestfile); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 61a098330c2..5c7d73eb136 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1159,7 +1159,7 @@ class SMTPs $this->_msgContent[$strType]['data'] = $strContent; if ( $this->getMD5flag() ) - $this->_msgContent[$strType]['md5'] = dol_hash($strContent); + $this->_msgContent[$strType]['md5'] = dol_hash($strContent, 3); //} } @@ -1329,7 +1329,7 @@ class SMTPs $this->_msgContent['attachment'][$strFileName]['data'] = $strContent; if ( $this->getMD5flag() ) - $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent); + $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, 3); } } @@ -1356,7 +1356,7 @@ class SMTPs $this->_msgContent['image'][$strImageName]['data'] = $strContent; if ( $this->getMD5flag() ) - $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent); + $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent, 3); } } // END DOL_CHANGE LDR @@ -1487,8 +1487,8 @@ class SMTPs function _setBoundary() { $this->_smtpsBoundary = "multipart_x." . time() . ".x_boundary"; - $this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2")); - $this->_smtpsAlternativeBoundary = 'mul_'.dol_hash(uniqid("dolibarr3")); + $this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3); + $this->_smtpsAlternativeBoundary = 'mul_'.dol_hash(uniqid("dolibarr3"), 3); } /** diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 87dfcf1367b..f00abaa339f 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -70,11 +70,11 @@ function dol_decode($chain) /** * Returns a hash of a string. - * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (md5 by default) - * If constant MAIN_SECURITY_SALT is defined, we use it as a salt + * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function. + * If constant MAIN_SECURITY_SALT is defined, we use it as a salt. * * @param string $chain String to hash - * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5) + * @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5) * @return string Hash of string */ function dol_hash($chain,$type=0) @@ -86,9 +86,12 @@ function dol_hash($chain,$type=0) if ($type == 1) return sha1($chain); else if ($type == 2) return sha1(md5($chain)); + else if ($type == 3) return md5($chain); else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain); else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain)); - else return md5($chain); + + // No enconding defined + return md5($chain); } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 40dd2c03ac3..fe0c9809296 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -440,7 +440,7 @@ function encodedecode_dbpassconf($level=0) /** * Return a generated password using default module * - * @param boolean $generic true=Create generic password (a MD5 string), false=Use the configured password generation module + * @param boolean $generic true=Create generic password (use default crypt function), false=Use the configured password generation module * @return string New value for password */ function getRandomPassword($generic=false) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 91f85d4cb0b..ffde48c2ada 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1154,7 +1154,7 @@ class User extends CommonObject $this->error = $langs->trans("ErrorBadEMail",$this->email); return -1; } - + $this->db->begin(); // Mise a jour autres infos @@ -1539,7 +1539,7 @@ class User extends CommonObject $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n"; $mesg.= "\n"; $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n"; - $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".dol_hash($password); + $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password); $mesg.= $url."\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n"; dol_syslog(get_class($this)."::send_password url=".$url); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 4d7422109bf..44377f6168c 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -49,7 +49,7 @@ $mode=$dolibarr_main_authentication; if (! $mode) $mode='http'; $username = GETPOST('username'); -$passwordmd5 = GETPOST('passwordmd5'); +$passwordhash = GETPOST('passwordhash'); $conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1); // Instantiate hooks of thirdparty module only if not already define @@ -68,7 +68,7 @@ if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) */ // Validate new password -if ($action == 'validatenewpassword' && $username && $passwordmd5) +if ($action == 'validatenewpassword' && $username && $passwordhash) { $edituser = new User($db); $result=$edituser->fetch('',$_GET["username"]); @@ -78,7 +78,7 @@ if ($action == 'validatenewpassword' && $username && $passwordmd5) } else { - if (dol_hash($edituser->pass_temp) == $passwordmd5) + if (dol_hash($edituser->pass_temp) == $passwordhash) { $newpassword=$edituser->setPassword($user,$edituser->pass_temp,0); dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 0d92aee8b76..e7160939532 100755 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -227,7 +227,7 @@ class SecurityTest extends PHPUnit_Framework_TestCase { global $conf; - $genpass1=getRandomPassword(true); // Should be a MD5 string return by dol_hash + $genpass1=getRandomPassword(true); // Should be a string return by dol_hash (if no option set, will be md5) print __METHOD__." genpass1=".$genpass1."\n"; $this->assertEquals(strlen($genpass1),32); From 0193b31a376f3d41830e16a0fedb95192120a189 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 16:18:03 +0200 Subject: [PATCH 56/98] Fix: td balance --- htdocs/expedition/shipment.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 07f004ca8d2..f1be4b07021 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref)) } // Onglet commande - $nbrow=7; + $nbrow=8; if (! empty($conf->projet->enabled)) $nbrow++; print '
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("ColorUser").''; - print $object->color; + print ''; + if ($object->color) print ''; print ' 
'; @@ -264,6 +264,7 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($commande->date_livraison,'daytext'); } print ''; + // Note on several rows print ''; @@ -277,7 +278,7 @@ if ($id > 0 || ! empty($ref)) if ($action != 'editshippingmethod' && $user->rights->expedition->creer) print ''; print '
'.$langs->trans('NotePublic').' :
'; print nl2br($commande->note_public); print '
id.'">'.img_edit($langs->trans('SetShippingMode'),1).'
'; - print ''; + print ''; if ($action == 'editshippingmethod') { $form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$commande->id, $commande->shipping_method_id, 'shipping_method_id', 1); } else { @@ -349,16 +350,16 @@ if ($id > 0 || ! empty($ref)) // Total HT print ''.$langs->trans('AmountHT').''; - print ''.price($commande->total_ht).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.price($commande->total_ht, 0, '', 1, -1, -1, $conf->currency).''; + print ''; // Total TVA - print ''.$langs->trans('AmountVAT').''.price($commande->total_tva).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($commande->total_tva, 0, '', 1, -1, -1, $conf->currency).''; + print ''; // Total TTC - print ''.$langs->trans('AmountTTC').''.price($commande->total_ttc).''; - print ''.$langs->trans('Currency'.$conf->currency).''; + print ''.$langs->trans('AmountTTC').''.price($commande->total_ttc, 0, '', 1, -1, -1, $conf->currency).''; + print ''; // Statut print ''.$langs->trans('Status').''; From 9c69ab966fbd6cb2272b6a194e55c5444fc2aa63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 16:27:15 +0200 Subject: [PATCH 57/98] Fix: When closing shipment, status was not visible until refresh. --- htdocs/expedition/card.php | 6 +-- htdocs/expedition/class/expedition.class.php | 44 +++++++++++--------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 14ef8738b73..2510bfea086 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1042,7 +1042,7 @@ else if ($id || $ref) } /* * Confirmation de l'annulation - */ + */ if ($action == 'annuler') { print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); @@ -1434,7 +1434,7 @@ else if ($id || $ref) $entrepot = new Entrepot($db); $entrepot->fetch($lines[$i]->entrepot_id); print $entrepot->getNomUrl(1); - } + } else if (count($lines[$i]->details_entrepot) > 1) { $detail = ''; @@ -1539,7 +1539,7 @@ else if ($id || $ref) print ''.$langs->trans($label).''; } } - + if ($user->rights->expedition->supprimer) { print ''.$langs->trans("Delete").''; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 898a65a05b8..c3d3d193bca 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -279,7 +279,7 @@ class Expedition extends CommonObject { // Call trigger $result=$this->call_trigger('SHIPPING_CREATE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers if (! $error) @@ -599,7 +599,7 @@ class Expedition extends CommonObject // We use warehouse selected for each line $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref)); if ($result < 0) { $error++; break; } - + if (! empty($conf->productbatch->enabled)) { $details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid); foreach ($details as $dbatch) { @@ -657,7 +657,7 @@ class Expedition extends CommonObject { // Call trigger $result=$this->call_trigger('SHIPPING_VALIDATE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -723,25 +723,25 @@ class Expedition extends CommonObject function addline($entrepot_id, $id, $qty) { global $conf, $langs; - + $num = count($this->lines); $line = new ExpeditionLigne($this->db); $line->entrepot_id = $entrepot_id; $line->origin_line_id = $id; $line->qty = $qty; - + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) { $orderline = new OrderLine($this->db); $orderline->fetch($id); $fk_product = $orderline->fk_product; - + if (!empty($orderline->fk_product)) { $product=new Product($this->db); $result=$product->fetch($fk_product); $product_type=$product->type; - + if($product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); @@ -866,7 +866,7 @@ class Expedition extends CommonObject { // Call trigger $result=$this->call_trigger('SHIPPING_MODIFY',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } } @@ -914,7 +914,7 @@ class Expedition extends CommonObject if ($conf->productbatch->enabled) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; - if ( ExpeditionLigneBatch::deletefromexp($this->db,$this->id)<0) + if ( ExpeditionLigneBatch::deletefromexp($this->db,$this->id)<0) {$error++;$this->errors[]="Error ".$this->db->lasterror();} } // Stock control @@ -980,7 +980,7 @@ class Expedition extends CommonObject { // Call trigger $result=$this->call_trigger('SHIPPING_DELETE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers if (! $error) @@ -1089,22 +1089,22 @@ class Expedition extends CommonObject while ($i < $num) { - $obj = $this->db->fetch_object($resql); - - if ($originline == $obj->fk_origin_line) { + $obj = $this->db->fetch_object($resql); + + if ($originline == $obj->fk_origin_line) { $line->entrepot_id = 0; // entrepod_id in details_entrepot - $line->qty_shipped += $obj->qty_shipped; + $line->qty_shipped += $obj->qty_shipped; } else { $line = new ExpeditionLigne($this->db); $line->entrepot_id = $obj->fk_entrepot; $line->qty_shipped = $obj->qty_shipped; } - + $detail_entrepot = new stdClass; $detail_entrepot->entrepot_id = $obj->fk_entrepot; $detail_entrepot->qty_shipped = $obj->qty_shipped; $line->details_entrepot[] = $detail_entrepot; - + $line->line_id = $obj->line_id; $line->fk_origin_line = $obj->fk_origin_line; $line->origin_line_id = $obj->fk_origin_line; // TODO deprecated @@ -1151,7 +1151,7 @@ class Expedition extends CommonObject // Eat-by date if (! empty($conf->productbatch->enabled)) { /* test on conf at begining of file sometimes doesn't include expeditionbatch - * May be conf is not well initialized for dark reason + * May be conf is not well initialized for dark reason */ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; if ($originline != $obj->fk_origin_line) { @@ -1172,7 +1172,7 @@ class Expedition extends CommonObject } $i++; - $originline = $obj->fk_origin_line; + $originline = $obj->fk_origin_line; } $this->db->free($resql); return 1; @@ -1547,10 +1547,14 @@ class Expedition extends CommonObject global $conf; $sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut=2'; - $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;'; - if ($this->db->query($sql) ) + $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0'; + + $resql=$this->db->query($sql); + if ($resql) { //TODO: Option to set order billed if 100% of order is shipped + $this->statut=2; + $this->billed=1; return 1; } else From 48b2d818dab5a7644aff19f47738976f72768027 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2014 16:29:22 +0200 Subject: [PATCH 58/98] Update changelog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 42a8d6d6b28..a1ec979f287 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ English Dolibarr ChangeLog - Fix: bug 1588 : relative discount - Fix: label of input method not tranlated. - Fix: box of customer and propsects were not correctly disabled. +- Fix: right and error management #1961 +- Fix: Fix Error when trying to clone an Order #1943 ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: From 9b24cccd0bf61bd3306a40d4f360eaf8f7f8af01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Oct 2014 12:24:36 +0200 Subject: [PATCH 59/98] Fix: Better layout detection --- htdocs/categories/categorie.php | 2 +- htdocs/core/class/html.formfile.class.php | 6 +++--- htdocs/core/class/mobiledetect.class.php | 15 ++++++++++----- htdocs/core/lib/functions.lib.php | 1 + htdocs/theme/eldy/style.css.php | 4 ++-- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index c74eefdc430..3200513d11d 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -634,7 +634,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) print ''; print ''; print ''; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 50c681d8366..674be61311d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -73,12 +73,12 @@ class FormFile global $conf,$langs, $hookmanager; $hookmanager->initHooks(array('formfile')); - if (! empty($conf->browser->phone)) return 0; + if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') return 0; if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2)) { - // TODO: Cheeck this works with 2 forms on same page - // TODO: Cheeck this works with GED module, otherwise, force useajax to 0 + // TODO: Check this works with 2 forms on same page + // TODO: Check this works with GED module, otherwise, force useajax to 0 // TODO: This does not support option savingdocmask // TODO: This break feature to upload links too return $this->_formAjaxFileUpload($object); diff --git a/htdocs/core/class/mobiledetect.class.php b/htdocs/core/class/mobiledetect.class.php index c39111d04be..0c7b742421a 100644 --- a/htdocs/core/class/mobiledetect.class.php +++ b/htdocs/core/class/mobiledetect.class.php @@ -155,7 +155,7 @@ class MobileDetect 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', // @ref: http://www.micromaxinfo.com/mobiles/smartphones // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', + 'Micromax' => 'Micromax.*\b(A\d+)\b', 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; @todo - complete the regex. 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) // @ref: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) @@ -179,7 +179,7 @@ class MobileDetect protected static $tabletDevices = array( 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic. 'NexusTablet' => 'Android.*Nexus[\s]+(7|10)|^.*Android.*Nexus(?:(?!Mobile).)*$', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705C|SM-T535|SM-T331', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. + 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P\d+|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-N8000|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-N8010|GT-N8005|GT-N8020|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|SM-T\d+|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-P6000|SM-T3100|SGH-I467|XE500|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. // @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/ 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE)\b', // Only the Surface tablets with Windows RT are considered mobile. @@ -963,10 +963,15 @@ class MobileDetect $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - if ($this->checkHttpHeadersForMobile()) { + if ($this->checkHttpHeadersForMobile()) + { + //print "Found it's a mobile from http header"; return true; - } else { - return $this->matchDetectionRulesAgainstUA(); + } + else + { + //print "Check into user agent ".$this->getUserAgent(); + return $this->matchDetectionRulesAgainstUA(); } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4be2583aa63..38e19eb31fd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -148,6 +148,7 @@ function getBrowserInfo() $detectmobile=new MobileDetect(); $phone=$detectmobile->isMobile(); $tablet=$detectmobile->isTablet(); + unset($detectmobile); // free memory return array('browsername'=>$name, 'browserversion'=>$version, 'browseros'=>$os, 'browserfirefox'=>$firefox, 'layout'=> ($tablet?'tablet':($phone?'phone':'classic')), 'phone'=>$phone, 'tablet'=>$tablet); } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 657d48f32d3..cd1801ca275 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -131,12 +131,12 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_LINEIMPAIR2='255,255,255'; $conf->global->THEME_ELDY_LINEIMPAIRHOVER='238,246,252'; $conf->global->THEME_ELDY_TEXT='50,50,130'; - if ($dol_use_jmobile) + /*if ($dol_use_jmobile) { $conf->global->THEME_ELDY_BACKTABCARD1='245,245,245'; // topmenu $conf->global->THEME_ELDY_BACKTABCARD2='245,245,245'; $conf->global->THEME_ELDY_BACKTABACTIVE='245,245,245'; - } + }*/ } $colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); From 3fe4c58e9585945a4fa528c48701f5559d503811 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Oct 2014 19:57:42 +0200 Subject: [PATCH 60/98] Use span class="badge" for notes. --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/mobiledetect.class.php | 4 ++-- htdocs/core/lib/company.lib.php | 6 +++--- htdocs/core/lib/contract.lib.php | 4 ++-- htdocs/core/lib/fichinter.lib.php | 4 ++-- htdocs/core/lib/fourn.lib.php | 8 ++++---- htdocs/core/lib/invoice.lib.php | 2 +- htdocs/core/lib/member.lib.php | 4 ++-- htdocs/core/lib/order.lib.php | 4 ++-- htdocs/core/lib/project.lib.php | 8 ++++---- htdocs/core/lib/propal.lib.php | 4 ++-- htdocs/core/lib/usergroups.lib.php | 4 ++-- htdocs/main.inc.php | 10 ++++++---- htdocs/theme/amarok/style.css.php | 14 ++++++++++++++ htdocs/theme/auguria/style.css.php | 15 +++++++++++++++ htdocs/theme/bureau2crea/style.css.php | 14 ++++++++++++++ htdocs/theme/cameleo/style.css.php | 14 ++++++++++++++ htdocs/theme/eldy/style.css.php | 23 +++++++++++++++++++++-- 18 files changed, 111 insertions(+), 33 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f41aaa5d19e..8848adea948 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -194,7 +194,7 @@ class Form { $ret.=''; } diff --git a/htdocs/core/class/mobiledetect.class.php b/htdocs/core/class/mobiledetect.class.php index 0c7b742421a..72d192a7614 100644 --- a/htdocs/core/class/mobiledetect.class.php +++ b/htdocs/core/class/mobiledetect.class.php @@ -155,7 +155,7 @@ class MobileDetect 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', // @ref: http://www.micromaxinfo.com/mobiles/smartphones // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A\d+)\b', + 'Micromax' => 'Micromax.*\bA\d+\b', 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; @todo - complete the regex. 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) // @ref: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) @@ -179,7 +179,7 @@ class MobileDetect protected static $tabletDevices = array( 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic. 'NexusTablet' => 'Android.*Nexus[\s]+(7|10)|^.*Android.*Nexus(?:(?!Mobile).)*$', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P\d+|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-N8000|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-N8010|GT-N8005|GT-N8020|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|SM-T\d+|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-P6000|SM-T3100|SGH-I467|XE500|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. + 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P\d+|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-N8000|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-N8010|GT-N8005|GT-N8020|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|SM-T\d+|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-P6000|SM-T3100|SGH-I467|XE500|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. // @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/ 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE)\b', // Only the Surface tablets with Windows RT are considered mobile. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e5723b9e2d6..964dcfbb0c6 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -131,7 +131,7 @@ function societe_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'notify'; $h++; } @@ -142,7 +142,7 @@ function societe_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; @@ -152,7 +152,7 @@ function societe_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'document'; $h++; } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index 51dba11df23..b7e82c6dbf2 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -60,7 +60,7 @@ function contract_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -70,7 +70,7 @@ function contract_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/contrat/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index d231b767753..89f685590b3 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -72,7 +72,7 @@ function fichinter_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -82,7 +82,7 @@ function fichinter_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index cc14c5ca4aa..c1e37f3c485 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -63,7 +63,7 @@ function facturefourn_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -73,7 +73,7 @@ function facturefourn_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'documents'; $h++; @@ -135,7 +135,7 @@ function ordersupplier_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -145,7 +145,7 @@ function ordersupplier_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 2afb4686162..f7f22c69b97 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -79,7 +79,7 @@ function facture_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; } diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 20a05a701aa..879478daf8d 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -88,7 +88,7 @@ function member_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $h++; $head[$h][0] = DOL_URL_ROOT.'/adherents/document.php?id='.$object->id; @@ -174,7 +174,7 @@ function member_stats_prepare_head($object) $head[$h][1] = $langs->trans("Country"); $head[$h][2] = 'statscountry'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/adherents/stats/geo.php?mode=memberbyregion'; $head[$h][1] = $langs->trans("Region"); $head[$h][2] = 'statsregion'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 0aa3c980911..ba3e8344f47 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -89,7 +89,7 @@ function commande_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -99,7 +99,7 @@ function commande_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'documents'; $h++; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 98a2b111c6f..b384ccceabe 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -71,7 +71,7 @@ function project_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'notes'; $h++; } @@ -81,7 +81,7 @@ function project_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'document'; $h++; @@ -149,7 +149,7 @@ function task_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'task_notes'; $h++; } @@ -458,7 +458,7 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr global $db, $user, $bc, $langs; global $form, $formother, $projectstatic, $taskstatic; - if (! is_object($formother)) + if (! is_object($formother)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index bc0c7cae868..8a96b86c967 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -83,7 +83,7 @@ function propal_prepare_head($object) if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; } @@ -93,7 +93,7 @@ function propal_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 69cad2c856b..630d2ae5b13 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -101,7 +101,7 @@ function user_prepare_head($object) if(!empty($object->note)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); - if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; @@ -111,7 +111,7 @@ function user_prepare_head($object) $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); $head[$h][0] = DOL_URL_ROOT.'/user/document.php?userid='.$object->id; $head[$h][1] = $langs->trans("Documents"); - if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + if($nbFiles > 0) $head[$h][1].= ' '.$nbFiles.''; $head[$h][2] = 'document'; $h++; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b20d94164d6..efca5d4efba 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -214,6 +214,7 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) $conf->browser->layout=$tmp['layout']; $conf->browser->phone=$tmp['phone']; // deprecated, use layout $conf->browser->tablet=$tmp['tablet']; // deprecated, use layout + //var_dump($conf->browser); } @@ -715,14 +716,14 @@ if (! GETPOST('nojs')) // If javascript was not disabled on URL } else $conf->use_javascript_ajax=0; -// Set terminal output option +// Set terminal output option according to conf->browser. if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1; if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1; if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1; if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1; -if (! empty($conf->browser->phone)) $conf->dol_no_mouse_hover=1; -if (! empty($conf->browser->phone) +if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $conf->dol_no_mouse_hover=1; +if ((! empty($conf->browser->layout) && $conf->browser->layout == 'phone') || (! empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) || (! empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400) ) @@ -731,12 +732,13 @@ if (! empty($conf->browser->phone) } // If we force to use jmobile, then we reenable javascript if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1; -// Disabled bugged themes +// Replace themes bugged with jmobile with eldy if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) { $conf->theme='eldy'; $conf->css = "/theme/".$conf->theme."/style.css.php"; } +//var_dump($conf->browser->phone); if (! defined('NOREQUIRETRAN')) { diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index b971cbad338..abfeef4aa2a 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -347,6 +347,20 @@ th .button { /* ! Message d'erreur lors du login : */ center .error { padding:8px !important; padding-left:26px !important; padding-right:20px; width:inherit; max-width:450px;color:#552323 !important; font-size:14px; border-radius:8px; text-align: left;} +.badge { + display: inline-block; + min-width: 10px; + padding: 2px 5px; + font-size: 10px; + font-weight: 700; + line-height: 0.9em; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} /* ============================================================================== */ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index e66c0d5623e..6e4ba602ade 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -228,6 +228,21 @@ div.inline-block .cursorpointer { cursor: pointer; } +.badge { + display: inline-block; + min-width: 10px; + padding: 2px 5px; + font-size: 10px; + font-weight: 700; + line-height: 0.9em; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} + /* ============================================================================== */ /* Styles to hide objects */ diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 3c4f7c8d712..b4573c1fc13 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -253,6 +253,20 @@ div.inline-block .cursorpointer { cursor: pointer; } +.badge { + display: inline-block; + min-width: 10px; + padding: 2px 5px; + font-size: 10px; + font-weight: 700; + line-height: 0.9em; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} /* ============================================================================== */ diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index be3403fabcb..096eab6c74d 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -229,6 +229,20 @@ div.inline-block .cursorpointer { cursor: pointer; } +.badge { + display: inline-block; + min-width: 10px; + padding: 2px 5px; + font-size: 10px; + font-weight: 700; + line-height: 0.9em; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} /* ============================================================================== */ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index cd1801ca275..3d2e138dd73 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -223,6 +223,7 @@ body { background-color: #FFFFFF; background: ; + /* background-image: url(""); */ color: #101010; font-size: px; @@ -409,6 +410,21 @@ th .button { .cursorpointer { cursor: pointer; } +.badge { + display: inline-block; + min-width: 10px; + padding: 2px 5px; + font-size: 10px; + font-weight: 700; + line-height: 0.9em; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} + /* ============================================================================== */ /* Styles to hide objects */ @@ -816,6 +832,9 @@ foreach($mainmenuusedarray as $val) .bodylogin { background: #f0f0f0; + -moz-box-shadow: inset 0 0 10px #000000; + -webkit-box-shadow: inset 0 0 10px #000000; + box-shadow: inset 0 0 10px #000000; } .login_vertical_align { padding: 10px; @@ -2962,9 +2981,9 @@ a.ui-link { } /* Warning: setting this may make screen not beeing refreshed after a combo selection */ -.ui-body-c { +/*.ui-body-c { background: #fff; -} +}*/ div.ui-radio, div.ui-checkbox { From 8d937d2d36ceafadfde049669ac3499ee1768234 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Oct 2014 20:37:46 +0200 Subject: [PATCH 61/98] Uniformize position of "Create link" on categories. --- htdocs/categories/categorie.php | 29 +++++++++++++---------------- htdocs/theme/eldy/style.css.php | 4 ++-- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 3200513d11d..e9e11b656b9 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -621,8 +621,17 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) if ($typeid == 3) $title = $langs->trans("MembersCategoriesShort"); if ($typeid == 4) $title = $langs->trans("ContactCategoriesShort"); + $linktocreate=''; + if ($showclassifyform && $user->rights->categorie->creer) + { + $linktocreate='id.'&type='.$typeid).'">'; + $linktocreate.=$langs->trans("CreateCat").' '; + $linktocreate.=img_picto($langs->trans("Create"),'filenew'); + $linktocreate.=""; + } + print '
'; - print_fiche_titre($title,'',''); + print_fiche_titre($title,$linktocreate,''); // Form to add record into a category if ($showclassifyform) @@ -636,17 +645,8 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) print '
'; - if ($user->rights->categorie->creer) - { - print ''; - } + print ''; + print ''; print ''; print '
'; - print $langs->trans("ClassifyInCategory").'  '; + print ''.$langs->trans("ClassifyInCategory").'  '; print $form->select_all_categories($typeid,'auto'); print ''; print ''; $ret.=''; - //$ret.='
'."\n"; + if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='
'."\n"; $ret.=''; $ret.='
'; print ''.$langs->trans("ClassifyInCategory").'  '; print $form->select_all_categories($typeid,'auto'); - print ''; - print ''; - print 'id.'&type='.$typeid).'">'; - print $langs->trans("CreateCat").' '; - print img_picto($langs->trans("Create"),'filenew'); - print ""; - print '
'; print ''; @@ -679,10 +679,7 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) print ""; // Categorie - print ""; - //$c->id=; - //print $c->getNomUrl(1); - print img_object('','category').' '.$way.""; + print "".img_object('','category').' '.$way.""; // Link to delete from category print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3d2e138dd73..8dde34aa105 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -832,9 +832,9 @@ foreach($mainmenuusedarray as $val) .bodylogin { background: #f0f0f0; - -moz-box-shadow: inset 0 0 10px #000000; + /*-moz-box-shadow: inset 0 0 10px #000000; -webkit-box-shadow: inset 0 0 10px #000000; - box-shadow: inset 0 0 10px #000000; + box-shadow: inset 0 0 10px #000000;*/ } .login_vertical_align { padding: 10px; From 718b3b19b45bb7df08bbccbe5518daab0ff237a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 11:16:51 +0200 Subject: [PATCH 62/98] Fix: user and date modification not updated --- htdocs/admin/agenda.php | 2 +- ...terface_50_modAgenda_ActionsAuto.class.php | 42 +++++++++++++++++++ htdocs/fichinter/class/fichinter.class.php | 16 ++++++- .../mysql/data/llx_c_action_trigger.sql | 3 +- .../install/mysql/migration/3.6.0-3.7.0.sql | 4 ++ 5 files changed, 63 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c7cb4258935..5ad9673a16f 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -154,7 +154,7 @@ print ''; print ''.$langs->trans("ActionsEvents").''; print ''.$langs->trans("All").'/'.$langs->trans("None").''; print ''."\n"; -// Show each trigger +// Show each trigger (list is in c_action_trigger) if (! empty($triggers)) { foreach ($triggers as $trigger) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index e7ccc31583c..9a6af993107 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -251,6 +251,20 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid=0; } + elseif ($action == 'FICHINTER_CREATE') + { + $langs->load("other"); + $langs->load("interventions"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + $object->fk_element=0; + $object->elementtype=''; + } elseif ($action == 'FICHINTER_VALIDATE') { $langs->load("other"); @@ -261,6 +275,20 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + $object->sendtoid=0; + $object->fk_element=0; + $object->elementtype=''; + } + elseif ($action == 'FICHINTER_MODIFY') + { + $langs->load("other"); + $langs->load("interventions"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + $object->sendtoid=0; $object->fk_element=0; $object->elementtype=''; @@ -290,6 +318,20 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid=0; } + elseif ($action == 'FICHINTER_DELETE') + { + $langs->load("other"); + $langs->load("interventions"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + $object->fk_element=0; + $object->elementtype=''; + } elseif ($action == 'SHIPPING_VALIDATE') { $langs->load("other"); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6f613dda5c8..783024df800 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -240,6 +240,7 @@ class Fichinter extends CommonObject $sql.= ", fk_projet = ".$this->fk_project; $sql.= ", note_private = ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); $sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); + $sql.= ", fk_user_modif = ".$user->id; $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -619,9 +620,11 @@ class Fichinter extends CommonObject global $conf; $sql = "SELECT f.rowid,"; - $sql.= " datec,"; + $sql.= " f.datec,"; + $sql.= " f.tms as date_modification,"; $sql.= " f.date_valid as datev,"; $sql.= " f.fk_user_author,"; + $sql.= " f.fk_user_modif as fk_user_modification,"; $sql.= " f.fk_user_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.rowid = ".$id; @@ -637,6 +640,7 @@ class Fichinter extends CommonObject $this->id = $obj->rowid; $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->date_modification); $this->date_validation = $this->db->jdate($obj->datev); $cuser = new User($this->db); @@ -649,6 +653,13 @@ class Fichinter extends CommonObject $vuser->fetch($obj->fk_user_valid); $this->user_validation = $vuser; } + if ($obj->fk_user_modification) + { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modification); + $this->user_modification = $muser; + } + } $this->db->free($resql); } @@ -805,7 +816,8 @@ class Fichinter extends CommonObject if ($user->rights->ficheinter->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; - $sql.= " SET description = '".$this->db->escape($description)."'"; + $sql.= " SET description = '".$this->db->escape($description)."',"; + $sql.= " fk_user_modif = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 6eddd5883c8..36f8e3ad9c3 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -32,7 +32,6 @@ -- List of all managed triggered events (used for trigger agenda and for notification) -- delete from llx_c_action_trigger; -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); @@ -58,6 +57,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index ee01ef4850c..89d017af12c 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -19,6 +19,10 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); +--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19); + + ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer; ALTER TABLE llx_c_actioncomm ADD COLUMN color varchar(9); From 0fba70d4d19739952711856be5f73d69842684b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 11:35:34 +0200 Subject: [PATCH 63/98] Fix: Triggers sending email for intervention and classify billed --- htdocs/core/class/html.formmail.class.php | 2 +- .../triggers/interface_50_modAgenda_ActionsAuto.class.php | 5 ++--- htdocs/fichinter/card.php | 2 +- htdocs/install/mysql/data/llx_c_action_trigger.sql | 7 +++---- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ htdocs/langs/en_US/interventions.lang | 1 + 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6242e4f7e3c..308534f3ebf 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -699,7 +699,7 @@ class FormMail $sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")"; if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; $sql.= $db->order("lang,label","ASC"); - print $sql; + //print $sql; $resql = $db->query($sql); if ($resql) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 9a6af993107..ffe539ff241 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -295,18 +295,17 @@ class InterfaceActionsAuto extends DolibarrTriggers } elseif ($action == 'FICHINTER_SENTBYMAIL') { - $langs->load("other"); + $langs->load("other"); $langs->load("interventions"); $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; - // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } - elseif ($action == 'FICHINTER_CLASSIFY_BILLED') + elseif ($action == 'FICHINTER_CLASSIFYBILLED') { $langs->load("other"); $langs->load("interventions"); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 983293916b6..95d197f401d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -752,7 +752,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; $actionmsg.=$message; } - $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + $actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); } // Create form object diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 36f8e3ad9c3..67363b98c72 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -50,22 +50,21 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); -insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 89d017af12c..80730138ab3 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -21,6 +21,8 @@ --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFYBILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19); ALTER TABLE llx_bank_account ADD COLUMN fk_user_author integer; diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 70fcbf7f22d..7655616ffc5 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -30,6 +30,7 @@ StatusInterInvoiced=Billed RelatedInterventions=Related interventions ShowIntervention=Show intervention SendInterventionRef=Submission of intervention %s +SendInterventionByMail=Send intervention by Email ##### Types de contacts ##### TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention TypeContact_fichinter_internal_INTERVENING=Intervening From 4df9fb38fbc527ade14e7e9a0176f836f4053e1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 12:29:35 +0200 Subject: [PATCH 64/98] Add option AGENDA_ALWAYS_HIDE_AUTO --- htdocs/comm/action/index.php | 7 +++++++ htdocs/comm/action/listactions.php | 11 +++++++++-- htdocs/comm/action/peruser.php | 7 +++++++ htdocs/core/class/html.formactions.class.php | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2098a07d20b..2a425cf51f9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -483,6 +483,13 @@ if ($resql) { $obj = $db->fetch_object($resql); + // Discard auto action if option is on + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO') + { + $i++; + continue; + } + // Create a new object action $event=new ActionComm($db); $event->id=$obj->id; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 4fc7386157b..4850394e557 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -156,7 +156,7 @@ if ($type) $param.="&type=".$type; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; $sql.= " a.fk_contact, a.note, a.label, a.percent as percent,"; -$sql.= " c.code as acode, c.libelle,"; +$sql.= " c.code as code, c.libelle,"; $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,"; $sql.= " ut.login as logintodo, ut.rowid as useridtodo,"; //$sql.= " ud.login as logindone, ud.rowid as useriddone,"; @@ -292,6 +292,13 @@ if ($resql) { $obj = $db->fetch_object($resql); + // Discard auto action if option is on + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO') + { + $i++; + continue; + } + $var=!$var; print ""; @@ -299,7 +306,7 @@ if ($resql) // Action (type) print ''; $actionstatic->id=$obj->id; - $actionstatic->type_code=$obj->acode; + $actionstatic->type_code=$obj->code; $actionstatic->libelle=$obj->label; print $actionstatic->getNomUrl(1,28); print ''; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index dacc7c5ce00..da34983779a 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -395,6 +395,13 @@ if ($resql) { $obj = $db->fetch_object($resql); + // Discard auto action if option is on + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO') + { + $i++; + continue; + } + // Create a new object action $event=new ActionComm($db); $event->id=$obj->id; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 696a70867cf..333969fc3b3 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -266,6 +266,8 @@ class FormActions if ($selected == 'manual') $selected='AC_OTH'; if ($selected == 'auto') $selected='AC_OTH_AUTO'; + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']); + print $form->selectarray($htmlname, $arraylist, $selected); if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } From 42a600412d3eb2d003537c5f4f423b6fa64acabf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 12:41:18 +0200 Subject: [PATCH 65/98] Fix: Regression with favorite. --- htdocs/admin/dict.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 4f600b49b91..d81f306be9e 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -680,7 +680,7 @@ if ($action == $acts[1]) } // favorite -if ($action == $acts[0]) +if ($action == 'activate_favorite') { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -700,7 +700,7 @@ if ($action == $acts[0]) } // disable favorite -if ($action == $acts[1]) +if ($action == 'disable_favorite') { if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } else { $rowidcol="rowid"; } @@ -973,7 +973,7 @@ if ($id) } // Favorite - Only activated on country dictionary if ($id == 4) print getTitleFieldOfList($langs->trans("Favorite"),0,$_SERVER["PHP_SELF"],"favorite",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); - + print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"active",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder); print ' '; print ''; @@ -1187,13 +1187,13 @@ if ($id) if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; } $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&'; - + // Favorite // Only activated on country dictionary if ($id == 4) { print ''; - if ($iserasable) print ''.$actl[$obj->favorite].''; + if ($iserasable) print ''.$actl[$obj->favorite].''; else print $langs->trans("AlwaysActive"); print ''; } From 881d338fca05b9b45a92dd746638307672bfba72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 13:07:54 +0200 Subject: [PATCH 66/98] Fix: label of events --- htdocs/comm/action/class/actioncomm.class.php | 23 ++++++++----------- htdocs/comm/action/index.php | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b631160afde..a9c1b68470a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -853,8 +853,8 @@ class ActionComm extends CommonObject } /** - * Renvoie nom clicable (avec eventuellement le picto) - * Utilise $this->id, $this->code et $this->label + * Return URL of event + * Use $this->id, $this->type_code and $this->label * * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $maxlength Nombre de caracteres max dans libelle @@ -865,32 +865,27 @@ class ActionComm extends CommonObject */ function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='') { - global $langs; + global $conf,$langs; $result=''; if ($option=='birthday') $lien = ''; else $lien = ''; $lienfin=''; $label=$this->label; - if (empty($label)) $label=$this->libelle; // Fro backward compatibility - //print 'rrr'.$this->libelle; + if (empty($label)) $label=$this->libelle; // For backward compatibility + //print 'rrr'.$this->libelle.'-'.$withpicto; if ($withpicto == 2) { $libelle=$label; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code); + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->transnoentities("Action".$this->type_code); $libelleshort=''; } - else if (empty($this->libelle)) - { - $libelle=$label; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code); - $libelleshort=dol_trunc($label, $maxlength); - } else { - $libelle=$label; - $libelleshort=dol_trunc($label,$maxlength); + $libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:'')); + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=$langs->transnoentities("Action".$this->type_code); + $libelleshort=dol_trunc($libelle,$maxlength); } if ($withpicto) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2a425cf51f9..a8ce45ea99a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1316,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print "
\n"; } else - { + { if ($showinfo) { print $langs->trans("EventOnFullDay")."
\n"; From 866b2a7a88b4dab476aeff1f9d2ef798b9367dc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 13:14:33 +0200 Subject: [PATCH 67/98] Fix: Label --- htdocs/comm/action/class/actioncomm.class.php | 8 ++++---- htdocs/comm/action/index.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a9c1b68470a..b31f686c9fe 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -854,7 +854,7 @@ class ActionComm extends CommonObject /** * Return URL of event - * Use $this->id, $this->type_code and $this->label + * Use $this->id, $this->type_code, $this->label and $this->type_label * * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $maxlength Nombre de caracteres max dans libelle @@ -884,15 +884,15 @@ class ActionComm extends CommonObject else { $libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:'')); - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=$langs->transnoentities("Action".$this->type_code); + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; $libelleshort=dol_trunc($libelle,$maxlength); } if ($withpicto) { - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) // Add code into () { - $libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); + $libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':''); } $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index a8ce45ea99a..89933991b6a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -414,7 +414,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; -$sql.= ' ca.code'; +$sql.= ' ca.code, ca.libelle as type_label'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; @@ -496,6 +496,7 @@ if ($resql) $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datef=$db->jdate($obj->datep2); $event->type_code=$obj->code; + $event->type_label=$obj->type_label; $event->libelle=$obj->label; $event->percentage=$obj->percent; $event->authorid=$obj->fk_user_author; // user id of creator From e324df2cb999fe96d5bfd3586e5af6f6212fde24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 13:20:19 +0200 Subject: [PATCH 68/98] Some fix again into event list. --- htdocs/comm/action/index.php | 6 +++--- htdocs/comm/action/listactions.php | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 89933991b6a..4630d486ebf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -414,7 +414,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; -$sql.= ' ca.code, ca.libelle as type_label'; +$sql.= ' ca.code as type_code, ca.libelle as type_label'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; @@ -484,7 +484,7 @@ if ($resql) $obj = $db->fetch_object($resql); // Discard auto action if option is on - if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO') + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code == 'AC_OTH_AUTO') { $i++; continue; @@ -495,7 +495,7 @@ if ($resql) $event->id=$obj->id; $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datef=$db->jdate($obj->datep2); - $event->type_code=$obj->code; + $event->type_code=$obj->type_code; $event->type_label=$obj->type_label; $event->libelle=$obj->label; $event->percentage=$obj->percent; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 4850394e557..c330540cb03 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -156,7 +156,7 @@ if ($type) $param.="&type=".$type; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; $sql.= " a.fk_contact, a.note, a.label, a.percent as percent,"; -$sql.= " c.code as code, c.libelle,"; +$sql.= " c.code as type_code, c.libelle as type_label,"; $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,"; $sql.= " ut.login as logintodo, ut.rowid as useridtodo,"; //$sql.= " ud.login as logindone, ud.rowid as useriddone,"; @@ -293,7 +293,7 @@ if ($resql) $obj = $db->fetch_object($resql); // Discard auto action if option is on - if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code == 'AC_OTH_AUTO') + if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code == 'AC_OTH_AUTO') { $i++; continue; @@ -306,7 +306,8 @@ if ($resql) // Action (type) print ''; $actionstatic->id=$obj->id; - $actionstatic->type_code=$obj->code; + $actionstatic->type_code=$obj->type_code; + $actionstatic->type_label=$obj->type_label; $actionstatic->libelle=$obj->label; print $actionstatic->getNomUrl(1,28); print ''; From 9278d210488cdb6919f55c0d6fe2d2c77fcc61e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 13:25:30 +0200 Subject: [PATCH 69/98] Add missing translation --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 28e19dd838d..9f87b945d71 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1535,6 +1535,7 @@ DeleteFiscalYear=Delete fiscal year ConfirmDeleteFiscalYear=Are you sure to delete this fiscal year ? Opened=Opened Closed=Closed +AlwaysEditable=Can always be edited Format=Format TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both customers and suppliers payment type From 8e63f09764cb46e292c78b201eb478700b210d12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Oct 2014 23:37:28 +0200 Subject: [PATCH 70/98] Fix: Confirm validate must be set on yes by default. --- htdocs/fichinter/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 95d197f401d..b5e874d03a6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1165,13 +1165,13 @@ else if ($id > 0 || ! empty($ref)) $formconfirm=''; - // Confirmation de la suppression de la fiche d'intervention + // Confirm deletion of intervention if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); } - // Confirmation validation + // Confirm validation if ($action == 'validate') { // on verifie si l'objet est en numerotation provisoire @@ -1191,16 +1191,16 @@ else if ($id > 0 || ! empty($ref)) } $text=$langs->trans('ConfirmValidateIntervention',$numref); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',1,1); } - // Confirmation de la validation de la fiche d'intervention + // Confirm back to draft if ($action == 'modify') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); } - // Confirmation de la suppression d'une ligne d'intervention + // Confirm deletion of line if ($action == 'ask_deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); @@ -1599,7 +1599,7 @@ else if ($id > 0 || ! empty($ref)) if ($object->statut == 0 && $user->rights->ficheinter->creer && (count($object->lines) > 0 || ! empty($conf->global->FICHINTER_DISABLE_DETAILS))) { print ''; + print '>'.$langs->trans("Validate").'
'; } // Modify From d267a788d0aa48b20cebba7ba2c3795720976087 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Oct 2014 20:02:16 +0200 Subject: [PATCH 71/98] Fix: use getpost --- htdocs/societe/ajaxcompanies.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 8771c0219c7..b3565a2ca26 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -81,7 +81,7 @@ if (GETPOST('newcompany') || GETPOST('socid','int') || GETPOST('id_fourn')) if (! empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql.=" OR rowid = '" . $db->escape($socid) . "'"; $sql.=")"; } - if (! empty($_GET["filter"])) $sql.= " AND ".$_GET["filter"]; // Add other filters + if (GETPOST("filter")) $sql.= " AND ".GETPOST("filter","alpha"); // Add other filters $sql.= " ORDER BY nom ASC"; //dol_syslog("ajaxcompanies", LOG_DEBUG); From 639d4f03a0b43eba7f1e2a917c7091ad88d70889 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Oct 2014 17:47:12 +0200 Subject: [PATCH 72/98] Experimentation option PROJECT_SHOW_REF_INTO_LISTS --- htdocs/fourn/facture/list.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e490c727a30..9439fc534bd 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (!$user->rights->fournisseur->facture->lire) accessforbidden(); @@ -109,8 +110,10 @@ llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:Factur $sql = "SELECT s.rowid as socid, s.nom as name, "; $sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, fac.date_lim_reglement as date_echeance,"; $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle"; +if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) $sql.=", p.rowid as project_id, p.ref as project_ref"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac"; +if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = fac.fk_projet"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE fac.entity = ".$conf->entity; $sql.= " AND fac.fk_soc = s.rowid"; @@ -212,6 +215,7 @@ if ($resql) print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"fac.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"fac.libelle","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print_liste_field_titre($langs->trans("Project"),$_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"fac.total_ht","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"fac.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="center"',$sortfield,$sortorder); @@ -239,7 +243,13 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; + if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) + { + print ''; + print ''; + } + print ''; print ''; print ''; print ''; @@ -252,6 +262,7 @@ if ($resql) $facturestatic=new FactureFournisseur($db); $supplierstatic=new Fournisseur($db); + $projectstatic=new Project($db); $var=true; $total=0; @@ -281,6 +292,15 @@ if ($resql) $supplierstatic->id=$obj->socid; $supplierstatic->name=$obj->name; print $supplierstatic->getNomUrl(1,'',12); + print ''; + if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) + { + $projectstatic->id=$obj->project_id; + $projectstatic->ref=$obj->project_ref; + print ''; + if ($obj->project_id > 0) print $projectstatic->getNomUrl(1); + print ''; + } print ''.price($obj->total_ht).''; print ''.price($obj->total_ttc).''; $total+=$obj->total_ht; @@ -301,6 +321,7 @@ if ($resql) // Print total print ''; print ''.$langs->trans("Total").''; + if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) print ''; print ''.price($total).''; print ''.price($total_ttc).''; print ' '; From d396c62499e5c251a14f9fa4069f7a0b5f48574c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Oct 2014 23:49:52 +0200 Subject: [PATCH 73/98] Fix: alignement --- htdocs/commande/card.php | 6 +++--- htdocs/holiday/index.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 60e5d81e37a..8485ec05f96 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1148,7 +1148,7 @@ else if ($action == 'update_extras') { /* * Add file in email form -*/ + */ if (GETPOST('addfile')) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -1162,7 +1162,7 @@ if (GETPOST('addfile')) { /* * Remove file in email form -*/ + */ if (GETPOST('removedfile')) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; @@ -1177,7 +1177,7 @@ if (GETPOST('removedfile')) { /* * Send mail -*/ + */ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { $langs->load('mails'); diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 9b0d1bbba62..04a96a7001d 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -257,7 +257,7 @@ print_liste_field_titre($langs->trans("Employe"),$_SERVER["PHP_SELF"],"cp.fk_use print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk_validator","",'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); -print_liste_field_titre($langs->trans("Duration")); +print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); print ''; print "\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f87b945d71..fe28b967d67 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1382,7 +1382,7 @@ MailingSetup=EMailing module setup MailingEMailFrom=Sender EMail (From) for emails sent by emailing module MailingEMailError=Return EMail (Errors-to) for emails with errors ##### Notification ##### -NotificationSetup=Notification bu email module setup +NotificationSetup=EMail notification module setup NotificationEMailFrom=Sender EMail (From) for emails sent for notifications ListOfAvailableNotifications=List of available notifications (This list depends on activated modules) ##### Sendings ##### From 1bbdd3798e373a1217d76b37c98775ff878e7991 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Oct 2014 00:53:41 +0200 Subject: [PATCH 74/98] Better contrast --- htdocs/theme/eldy/style.css.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8dde34aa105..90826327b59 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1004,9 +1004,9 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks background-repeat:repeat-x; border-left: 1px solid #AAA; - border-right: 1px solid #CCC; - border-bottom: 1px solid #CCC; - border-top: 1px solid #CCC; + border-right: 1px solid #BBB; + border-bottom: 1px solid #BBB; + border-top: 1px solid #BBB; border-radius: 5px; -moz-border-radius: 5px; -moz-box-shadow: 3px 3px 4px #DDD; @@ -1361,10 +1361,10 @@ div.tabBar { -moz-border-radius:6px; -webkit-border-radius: 6px; border-radius: 6px; - border-right: 1px solid #CCCCCC; - border-bottom: 1px solid #CCCCCC; - border-left: 1px solid #D0D0D0; - border-top: 1px solid #D8D8D8; + border-right: 1px solid #BBB; + border-bottom: 1px solid #BBB; + border-left: 1px solid #BBB; + border-top: 1px solid #CCC; width: auto; background-image: -o-linear-gradient(bottom, rgba(, 0.5) 25%, rgba(, 0.5) 100%); @@ -1420,9 +1420,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { box-shadow: 0 -1px 4px rgba(0,0,0,.1); border-bottom: none; - border-right: 1px solid #CCCCCC; - border-left: 1px solid #D0D0D0; - border-top: 1px solid #D8D8D8; + border-right: 1px solid #BBB; + border-left: 1px solid #BBB; + border-top: 1px solid #CCC; background-image: -o-linear-gradient(bottom, rgb() 35%, rgb() 100%); From 4d515d660cfad3afe953f9180b4477bc780eff8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Oct 2014 14:17:36 +0200 Subject: [PATCH 75/98] New: Feature to link manually an order to an invoice does not disappear once link has been done. --- ChangeLog | 2 ++ htdocs/compta/facture.php | 24 ++++++++++++------- htdocs/fourn/facture/card.php | 18 +++++++++----- .../facture/tpl/linkedobjectblock.tpl.php | 1 + 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c9c2b8a039..350f5ba7b6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Feature to link manually an order to an invoice does not disappear once + link has been done. - New: Can set a color on user card (visible into agenda view). - New: extrafields for projects and tasks are exported to ODT documents. - New: Add number of active notification into tab title (like we do for notes and documents) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index eb4ca29f022..27dbcc5c83c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3579,21 +3579,24 @@ if ($action == 'create') // Linked object block $somethingshown = $object->showLinkedObjectBlock(); - if (empty($somethingshown) && ! empty($conf->commande->enabled)) + $linktoelem=''; + + if (! empty($conf->commande->enabled)) { - print '
' . $langs->trans('LinkedOrder') . ''; + $linktoelem.=($linktoelem?'   ':'').'' . $langs->trans('LinkedOrder') . ''; print ' '; - print '