From 3a053e3fedd5bb3b7668d128750461a6adc8b4ed Mon Sep 17 00:00:00 2001 From: Gregory DAVID Date: Fri, 7 Feb 2014 18:08:25 +0100 Subject: [PATCH 001/171] =?UTF-8?q?Donne=20la=20possibilit=C3=A9=20de=20fa?= =?UTF-8?q?ire=20un=20filtrage=20sur=20les=20agenda=20en=20fonction=20du?= =?UTF-8?q?=20num=C3=A9ro=20de=20projet=20pass=C3=A9=20en=20GET=20:=20&pro?= =?UTF-8?q?ject=3DXX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/action/class/actioncomm.class.php | 1 + htdocs/public/agenda/agendaexport.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 10082062d06..9f1a5cdfeff 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -893,6 +893,7 @@ class ActionComm extends CommonObject if ($key == 'id') $sql.=" AND a.id=".(is_numeric($value)?$value:0); if ($key == 'idfrom') $sql.=" AND a.id >= ".(is_numeric($value)?$value:0); if ($key == 'idto') $sql.=" AND a.id <= ".(is_numeric($value)?$value:0); + if ($key == 'project') $sql.=" AND a.fk_project=".(is_numeric($value)?$value:0); if ($key == 'login') { $login=$value; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index efc4f132764..63889f89385 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -65,6 +65,7 @@ if (! empty($_GET["year"])) $filters['year']=$_GET["year"]; if (! empty($_GET["id"])) $filters['id']=$_GET["id"]; if (! empty($_GET["idfrom"])) $filters['idfrom']=$_GET["idfrom"]; if (! empty($_GET["idto"])) $filters['idto']=$_GET["idto"]; +if (! empty($_GET["project"])) $filters['project']=$_GET["project"]; if (! empty($_GET["login"])) $filters['login']=$_GET["login"]; if (! empty($_GET["logina"])) $filters['logina']=$_GET["logina"]; if (! empty($_GET["logint"])) $filters['logint']=$_GET["logint"]; @@ -107,6 +108,7 @@ foreach ($filters as $key => $value) if ($key == 'id') $filename.='-id'.$value; if ($key == 'idfrom') $filename.='-idfrom'.$value; if ($key == 'idto') $filename.='-idto'.$value; + if ($key == 'project') $filename.='-project'.$value; if ($key == 'login') $filename.='-login'.$value; if ($key == 'logina') $filename.='-logina'.$value; // Author if ($key == 'logind') $filename.='-logind'.$value; // Affected to From 9c7647a7aeb8778faa5361dbd97cc765476b03c8 Mon Sep 17 00:00:00 2001 From: astebert Date: Tue, 12 Aug 2014 11:45:11 +0200 Subject: [PATCH 002/171] Update bills.lang Ligne 252 : Changement grammatical - de "Paiements issue de l'acompte" - en "Paiement issu de l'acompte" --- htdocs/langs/fr_FR/bills.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index debbe4f4d33..9e9980f9091 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -249,7 +249,7 @@ AddCreditNote=Créer facture avoir Deposit=Acompte Deposits=Acomptes DiscountFromCreditNote=Remise issue de l'avoir %s -DiscountFromDeposit=Paiements issue de l'acompte %s +DiscountFromDeposit=Paiement issu de l'acompte %s AbsoluteDiscountUse=Ce type de crédit ne peut s'utiliser que sur une facture non validée CreditNoteDepositUse=La facture doit être validée pour pouvoir utiliser ce type de crédit NewGlobalDiscount=Nouvelle ligne de déduction From bc669f1702cf9b6efb3a04cdd3e37520f2d0900c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 9 Oct 2014 13:54:52 +0200 Subject: [PATCH 003/171] Merge --- htdocs/categories/viewcat.php | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 14a63ffc837..c55f324ab06 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -38,7 +38,7 @@ $type=GETPOST('type'); $action=GETPOST('action'); $confirm=GETPOST('confirm'); $removeelem = GETPOST('removeelem','int'); -$elemid=GETPOST('elemid'); +$elemid=GETPOST('elemid'); if ($id == "") { @@ -121,32 +121,32 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi } } -if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer)) +if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer)) { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $newobject = new Product($db); - $result = $newobject->fetch($elemid); + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $newobject = new Product($db); + $result = $newobject->fetch($elemid); $elementtype = 'product'; // TODO Add into categ - $result=$object->add_type($newobject,$elementtype); - if ($result >= 0) - { - setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref)); - } - else - { - if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings'); - } - else - { - setEventMessages($object->error,$object->errors,'errors'); - } - } - -} + $result=$object->add_type($newobject,$elementtype); + if ($result >= 0) + { + setEventMessage($langs->trans("WasAddedSuccessfully",$newobject->ref)); + } + else + { + if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + setEventMessage($langs->trans("ObjectAlreadyLinkedToCategory"),'warnings'); + } + else + { + setEventMessages($object->error,$object->errors,'errors'); + } + } + +} @@ -292,26 +292,26 @@ if ($object->type == 0) { $showclassifyform=1; $typeid=0; - // Form to add record into a category - if ($showclassifyform) - { + // Form to add record into a category + if ($showclassifyform) + { print '
'; - print '
'; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print '
'; - print $langs->trans("AddProductServiceIntoCategory").'  '; - print $form->select_produits('','elemid','',0,0,-1,2,'',1); - print ''; - print '
'; - print '
'; - } + print ''; + print ''; + print ''; + print '
'; + print $langs->trans("AddProductServiceIntoCategory").'  '; + print $form->select_produits('','elemid','',0,0,-1,2,'',1); + print ''; + print '
'; + print ''; + } print "
"; print "\n"; From 104592b349bfe241907266a51361d48413b62f72 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 12 Oct 2014 19:08:34 +0200 Subject: [PATCH 004/171] Fix: wrong function name --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 7a855eb9325..394dd4fad82 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -703,7 +703,7 @@ class Translate */ function getCurrencyAmount($currency_code, $amount) { - $symbol=$this->getCurrencSymbol($currency_code); + $symbol=$this->getCurrencySymbol($currency_code); if (in_array($currency_code, array('USD'))) return $symbol.$amount; else return $amount.$symbol; From 756b1d31ad24a7908a875e180ebc7a759ef31311 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 01:01:30 +0200 Subject: [PATCH 005/171] 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 b5bac3b0ab0..c7d1546e976 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -427,6 +427,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 * @@ -3468,6 +3480,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 a94f7dc3ad0ca782941c5c9129828e2c32f9524d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2014 01:21:33 +0200 Subject: [PATCH 006/171] Revert "Add function dolEscapeXML" This reverts commit 756b1d31ad24a7908a875e180ebc7a759ef31311. --- htdocs/core/lib/functions.lib.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c7d1546e976..b5bac3b0ab0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -427,18 +427,6 @@ 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 * @@ -3480,7 +3468,6 @@ 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 96aee6eed4926ee4dfc00f4250587d47014d9a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 15:48:59 +0200 Subject: [PATCH 007/171] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4bc6da083aa..2f9732a0876 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -460,21 +460,18 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, } /** - * On/off button for product tosell or tobuy + * On/off button for object * - * @param int $id Id product to set - * @param string $code Name of constant : status or status_buy + * @param int $object Object to set + * @param string $code Name of constant : status or status_buy for product by example * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @return void */ -function ajax_productonoff($id, $code, $input=array()) +function ajax_object_onoff($object, $code, $input=array()) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; global $conf, $langs, $db; - $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').''; + $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').''; + $out.= ''.img_picto($langs->trans("ProductStatusNotOnBuy"),'switch_off').''; + $out.= ''.img_picto($langs->trans("ProductStatusOnBuy"),'switch_on').''; } return $out; } From 830ec9c9cb2f9d5684ac5f0cc7d6ec06e6ef3d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 16:36:28 +0200 Subject: [PATCH 012/171] Update list.php --- htdocs/product/list.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index ebcd3245e7d..7e817d69725 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -507,11 +507,25 @@ else } } - // Status (to buy) - print ''; - + $product_static->status_buy = $objp->tobuy; + $product_static->status = $objp->tosell; // Status (to sell) - print ''; + print ''; + + // Status (to buy) + print ''; print ''; From a7941805861434e9af68889c175d70e621693164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20DAVID?= Date: Sat, 18 Oct 2014 16:41:47 +0200 Subject: [PATCH 013/171] Document the ability to export agenda calendar restricted to project ID --- htdocs/admin/agenda_xcal.php | 3 ++- htdocs/langs/en_US/agenda.lang | 1 + htdocs/langs/fr_FR/agenda.lang | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 135429e15d3..4e9005a27de 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -174,7 +174,8 @@ $message=$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions2",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login); +$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login).'
'; +$message.=$langs->trans("AgendaUrlOptionsProject",$user->login,$user->login); print info_admin($message); if (! empty($conf->use_javascript_ajax)) diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 187f818210e..b777ed2838a 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -65,6 +65,7 @@ AgendaUrlOptions2=login=%s to restrict output to actions created by, assi AgendaUrlOptions3=logina=%s to restrict output to actions created by user %s. AgendaUrlOptions4=logint=%s to restrict output to actions assigned to user %s. AgendaUrlOptions5=logind=%s to restrict output to actions done by user %s. +AgendaUrlOptionsProject=project=PROJECT_ID to restrict output to actions associated to project PROJECT_ID. AgendaShowBirthdayEvents=Show birthday's contacts AgendaHideBirthdayEvents=Hide birthday's contacts Busy=Busy diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 190c08ad2ac..766b5aca829 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -65,6 +65,7 @@ AgendaUrlOptions2=login=%s pour limiter l'export aux actions créées, af AgendaUrlOptions3=logina=%s pour limiter l'export aux actions créées par l'utilisateur %s. AgendaUrlOptions4=logint=%s pour limiter l'export aux actions affectées à l'utilisateur %s. AgendaUrlOptions5=logind=%s pour limiter l'export aux actions réalisées par l'utilisateur %s. +AgendaUrlOptionsProject=project=PROJECT_ID pour limiter l'export aux actions associées au projet dont l'identifiant est PROJECT_ID. AgendaShowBirthdayEvents=Afficher l'anniversaire des contacts AgendaHideBirthdayEvents=Cacher l'anniversaire des contacts Busy=Occupé From dd5ea670e2e5bdb30dd0b7bab7df181ef8620abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 17:11:02 +0200 Subject: [PATCH 014/171] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 46442460feb..0057f976a75 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -469,7 +469,6 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, */ function ajax_object_onoff($object, $code, $input=array()) { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; global $conf, $langs, $db; $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').''; - } + $out.= ''.img_picto($langs->trans($text_off),'switch_off').''; + $out.= ''.img_picto($langs->trans($text_on),'switch_on').''; + return $out; } From 446e73d8b80e5b977d484d2a70c5ebda5f9ff600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 18:49:47 +0200 Subject: [PATCH 018/171] 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 cd75ab3e2bb..eadb701e4a8 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1421,7 +1421,7 @@ else // Status (to sell) print '
'; print ''; print $htmllogobar; $htmllogobar=''; print ''; From c103a5927a9596cb34747556789b26d9c2854314 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 20 Oct 2014 22:28:08 +0200 Subject: [PATCH 027/171] Update commondocgenerator.class.php add : outstanding limit on ODT fix : only public note are display on ODT (private stay private) --- htdocs/core/class/commondocgenerator.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a16b0cb16b6..d1048acbc23 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -118,8 +118,9 @@ abstract class CommonDocGenerator 'mycompany_idprof5'=>$mysoc->idprof5, 'mycompany_idprof6'=>$mysoc->idprof6, 'mycompany_vatnumber'=>$mysoc->tva_intra, + 'outstanding_limit'=>$mysoc->outstanding_limit, // Only private not exists for "mysoc" - 'mycompany_note'=>$mysoc->note_private + 'mycompany_note'=>$mysoc->note_public //'mycompany_note_private'=>$mysoc->note_private, //'mycompany_note_public'=>$mysoc->note_public, ); From 29db45c76330900046cb456de645357f17f6a107 Mon Sep 17 00:00:00 2001 From: jfefe Date: Thu, 23 Oct 2014 01:15:05 +0200 Subject: [PATCH 028/171] Avoid missing class error for fetch_thirdparty method --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6439e3e003e..e363eda6e4a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -575,6 +575,9 @@ abstract class CommonObject global $conf; if (empty($this->socid)) return 0; + + if (!class_exists('Societe')) + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $thirdparty = new Societe($this->db); $result=$thirdparty->fetch($this->socid); From ba9d2c3690e4c5f65fc3ca35f9930200ea15ac46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 11:02:16 +0200 Subject: [PATCH 029/171] Update card.php --- htdocs/product/card.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 889c782808b..9f2f0685beb 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1436,12 +1436,16 @@ else } print ''; - // Batch number management (to batch) - if ($conf->productbatch->enabled) { - print ''; - } + // Batch number management (to batch) + if ($conf->productbatch->enabled) { + print ''; + } // Description print ''; From 19e194dd814aad0c4eb2d36074305f022f8d28d1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Oct 2014 12:01:15 +0200 Subject: [PATCH 030/171] encrease name length for societe --- htdocs/install/mysql/tables/llx_adherent.sql | 2 +- htdocs/install/mysql/tables/llx_societe.sql | 2 +- htdocs/societe/soc.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 9e4db2b604a..e7f9c246834 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -37,7 +37,7 @@ create table llx_adherent pass varchar(50), -- password fk_adherent_type integer NOT NULL, morphy varchar(3) NOT NULL, -- personne morale / personne physique - societe varchar(60), -- company name (should be same lenght than societe.name) + societe varchar(128), -- company name (should be same lenght than societe.name) fk_soc integer NULL, -- Link to third party linked to member address text, zip varchar(30), diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index bfe69b0d5f8..25629424037 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -22,7 +22,7 @@ create table llx_societe ( rowid integer AUTO_INCREMENT PRIMARY KEY, - nom varchar(60), -- company reference name (should be smae length than adherent.societe) + nom varchar(128), -- company reference name (should be same length than adherent.societe) entity integer DEFAULT 1 NOT NULL, -- multi company id ref_ext varchar(128), -- reference into an external system (not used by dolibarr) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a0b9bda1c8e..65b1e4783d8 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -805,7 +805,7 @@ else print ''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; + print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; @@ -816,7 +816,7 @@ else if ($conf->use_javascript_ajax) { print ''; - print ''; + print ''; print ''; print ''; @@ -1266,7 +1266,7 @@ else // Name print ''; - print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field From 10f419e372102a7033f589c8f8c9190782f496bc Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Thu, 23 Oct 2014 13:08:39 +0200 Subject: [PATCH 031/171] error on adding fields (bad function --- htdocs/core/class/commondocgenerator.class.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d1048acbc23..26f209ed107 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -118,11 +118,9 @@ abstract class CommonDocGenerator 'mycompany_idprof5'=>$mysoc->idprof5, 'mycompany_idprof6'=>$mysoc->idprof6, 'mycompany_vatnumber'=>$mysoc->tva_intra, - 'outstanding_limit'=>$mysoc->outstanding_limit, - // Only private not exists for "mysoc" - 'mycompany_note'=>$mysoc->note_public - //'mycompany_note_private'=>$mysoc->note_private, - //'mycompany_note_public'=>$mysoc->note_public, + // Only private not exists for "mysoc" + 'mycompany_note_private'=>$mysoc->note_private, + ); } @@ -167,6 +165,7 @@ abstract class CommonDocGenerator 'company_customeraccountancycode'=>$object->code_compta, 'company_supplieraccountancycode'=>$object->code_compta_fournisseur, 'company_juridicalstatus'=>$object->forme_juridique, + 'company_outstanding_limit'=>$object->outstanding_limit, 'company_capital'=>$object->capital, 'company_idprof1'=>$object->idprof1, 'company_idprof2'=>$object->idprof2, From 463904706bb545349cc9a37eea9c49921618b687 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Oct 2014 15:02:49 +0200 Subject: [PATCH 032/171] better display margin infos --- htdocs/core/class/commonobject.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9996337736a..22d3c2ffc59 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3012,13 +3012,13 @@ abstract class CommonObject print '
'.$product_static->LibStatut($objp->tosell,5,0).''.$product_static->LibStatut($objp->tobuy,5,1).''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_object_onoff($product_static, 'status'); + } else { + print $product_static->LibStatut($objp->tosell,5,0); + } + print ''; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_object_onoff($product_static, 'status_buy'); + } else { + print $product_static->LibStatut($objp->tobuy,5,1); + } + print ' 
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($object, 'status'); + print ajax_object_onoff($object, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $object->getLibStatut(2,0); } @@ -1430,7 +1430,7 @@ else // Status (to buy) print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($object, 'status_buy'); + print ajax_object_onoff($object, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $object->getLibStatut(2,1); } From 3ab8e13157008752c5a8c3a87ab01e2da3c8baba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 18:51:25 +0200 Subject: [PATCH 019/171] Update list.php --- htdocs/product/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7e817d69725..e77115eb72f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -512,7 +512,7 @@ else // Status (to sell) print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product_static, 'status'); + print ajax_object_onoff($product_static, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product_static->LibStatut($objp->tosell,5,0); } @@ -521,7 +521,7 @@ else // Status (to buy) print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product_static, 'status_buy'); + print ajax_object_onoff($product_static, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $product_static->LibStatut($objp->tobuy,5,1); } From 3144fd6845a8e3b0d36759b2459babf9dcd66322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 18:52:16 +0200 Subject: [PATCH 020/171] Update product.php --- htdocs/product/stock/product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 4938ec3e033..dd507883674 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -279,7 +279,7 @@ if ($id > 0 || $ref) // Status (to sell) print '
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product, 'status'); + print ajax_object_onoff($product, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product->getLibStatut(2,0); } @@ -288,7 +288,7 @@ if ($id > 0 || $ref) // Status (to buy) print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product, 'status_buy'); + print ajax_object_onoff($product, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $product->getLibStatut(2,1); } From a1bedcc26351f0e8da140cf0ec16de7b4cb41a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:46:13 +0200 Subject: [PATCH 021/171] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 84e1a536465..709911faaec 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -462,14 +462,15 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, /** * On/off button for object * - * @param int $object Object to set + * @param int $object Id product to set * @param string $code Name of constant : status or status_buy for product by example + * @param string $field Name of database field : tosell or tobuy for product by example * @param string $text_on Text if on * @param string $text_off Text if off * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @return void */ -function ajax_object_onoff($object, $code, $text_on, $text_off, $input=array()) +function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input=array()) { global $langs; @@ -480,8 +481,10 @@ function ajax_object_onoff($object, $code, $text_on, $text_off, $input=array()) // Set constant $("#set_'.$code.'_'.$object->id.'").click(function() { $.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", { - action: \'set'.$code.'\', + action: \'set\', + field: \''.$field.'\', value: \'1\', + element: \''.$object->element.'\', id: \''.$object->id.'\' }, function() { @@ -508,8 +511,10 @@ function ajax_object_onoff($object, $code, $text_on, $text_off, $input=array()) // Del constant $("#del_'.$code.'_'.$object->id.'").click(function() { $.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", { - action: \'set'.$code.'\', + action: \'set\', + field: \''.$field.'\', value: \'0\', + element: \''.$object->element.'\', id: \''.$object->id.'\' }, function() { From 5b9a134d6970cdbe476d581de952ebbc78160651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:47:12 +0200 Subject: [PATCH 022/171] Update objectonoff.php --- htdocs/core/ajax/objectonoff.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 05eebc7a65f..6ac5abd3bbb 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -32,9 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; $action=GETPOST('action','alpha'); $id=GETPOST('id', 'int'); $value=GETPOST('value', 'int'); +$field=GETPOST('field', 'alpha'); +$element=GETPOST('element', 'alpha'); $object = new GenericObject($db); - /* * View */ @@ -44,9 +45,5 @@ top_httphead(); print ''."\n"; // 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); -} +if (($action == 'set') && ! empty($id)) + $object->setValueFrom($field, $value, $element, $id); From 5e946d646659e20d005aa8e6b4c35320f9f88a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:49:07 +0200 Subject: [PATCH 023/171] 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 eadb701e4a8..889c782808b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1421,7 +1421,7 @@ else // Status (to sell) print '
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($object, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + print ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $object->getLibStatut(2,0); } @@ -1430,7 +1430,7 @@ else // Status (to buy) print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($object, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + print ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $object->getLibStatut(2,1); } From 8133b67878ed7067b7af91ca5bba1c0d4f6741de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:50:17 +0200 Subject: [PATCH 024/171] Update product.php --- htdocs/product/stock/product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index dd507883674..7885553095e 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -279,7 +279,7 @@ if ($id > 0 || $ref) // Status (to sell) print '
'.$langs->trans("Status").' ('.$langs->trans("Sell").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + print ajax_object_onoff($product, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product->getLibStatut(2,0); } @@ -288,7 +288,7 @@ if ($id > 0 || $ref) // Status (to buy) print '
'.$langs->trans("Status").' ('.$langs->trans("Buy").')'; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + print ajax_object_onoff($product, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $product->getLibStatut(2,1); } From 761fc32cc1123cc11d8a24363ab3eaf4ca370741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:51:24 +0200 Subject: [PATCH 025/171] Update list.php --- htdocs/product/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index e77115eb72f..76049fd1ef3 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -512,7 +512,7 @@ else // Status (to sell) print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product_static, 'status', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); + print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); } else { print $product_static->LibStatut($objp->tosell,5,0); } @@ -521,7 +521,7 @@ else // Status (to buy) print ''; if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { - print ajax_object_onoff($product_static, 'status_buy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); + print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); } else { print $product_static->LibStatut($objp->tobuy,5,1); } From a14d07930a2f9acbf635e2008af0896d0e38ec07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2014 22:52:54 +0200 Subject: [PATCH 026/171] Update soc.php --- htdocs/societe/soc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a0b9bda1c8e..b49a1678b00 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1698,7 +1698,11 @@ else // Status print '
'.$langs->trans("Status").''; - print $object->getLibStatut(2); + if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer) { + print ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); + } else { + print $object->getLibStatut(2); + } print '
'.$langs->trans("Status").' ('.$langs->trans("Lot").')'; - print $object->getLibStatut(2,2); - print '
'.$langs->trans("Status").' ('.$langs->trans("Lot").')'; + if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { + print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); + } else { + print $object->getLibStatut(2,2); + } + print '
'.$langs->trans("Description").''.(dol_textishtml($object->description)?$object->description:dol_nl2br($object->description,1,true)).'
'.$langs->trans('Prefix').'
 
'; print $formcompany->select_civility($object->civility_id).'
'; print ''; - print ''; - print ''; + print ''; + print ''; if ($conf->global->MARGIN_TYPE == "1") - print ''; + print ''; else - print ''; - print ''; + print ''; + print ''; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''; if (! empty($conf->global->DISPLAY_MARK_RATES)) From 36ff576d1566377785c32c66a2c6df894aa93595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 17:48:51 +0200 Subject: [PATCH 033/171] "Is Order shippable" icon --- htdocs/commande/list.php | 59 +++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index bd31a438b05..f7c56130c2d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -33,6 +33,7 @@ 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.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; $langs->load('orders'); $langs->load('deliveries'); @@ -325,22 +326,54 @@ if ($resql) $total=0; $subtotal=0; - $generic_commande = new Commande($db); - while ($i < min($num,$limit)) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ''; - print ''; + print ''; // Shippable Icon - if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && ! empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { $notshippable=0; $text_info=''; $nbprod=0; From 64a5a260dd76d2f923bf802aba21a99dba604026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 25 Oct 2014 11:54:38 +0200 Subject: [PATCH 043/171] Update admin.lang --- 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 9f87b945d71..014229d62d5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1146,6 +1146,7 @@ HideTreadedOrders=Hide the treated or cancelled orders in the list ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes it possible not to step by the provisional order FreeLegalTextOnOrders=Free text on orders WatermarkOnDraftOrders=Watermark on draft orders (none if empty) +ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with your clicktodial login (defined on your user card)
__PASS__ that will be replaced with your clicktodial password (defined on your user card). From 3a626d850397f86c355d514e0feffd3b53e58557 Mon Sep 17 00:00:00 2001 From: MAxime Kohlhaas Date: Sat, 25 Oct 2014 17:22:03 +0200 Subject: [PATCH 044/171] Add : statistics on supplier orders and invoices on home page --- .../class/fournisseur.commande.class.php | 41 +++++++++++++++++ .../fourn/class/fournisseur.facture.class.php | 42 +++++++++++++++++ htdocs/index.php | 46 ++++++++++++------- 3 files changed, 113 insertions(+), 16 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7983060490d..6c097cd6d5b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1923,6 +1923,47 @@ class CommandeFournisseur extends CommonOrder } } + /** + * Charge indicateurs this->nb de tableau de bord + * + * @return int <0 si ko, >0 si ok + */ + function load_state_board() + { + global $conf, $user; + + $this->nb=array(); + $clause = "WHERE"; + + $sql = "SELECT count(co.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as co"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON co.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = "AND"; + } + $sql.= " ".$clause." co.entity = ".$conf->entity; + + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nb["supplier_orders"]=$obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } + /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9c72319f74f..c7067410c41 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1606,6 +1606,48 @@ class FactureFournisseur extends CommonInvoice $this->total_ttc = $xnbp*119.6; } + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @return int <0 if KO, >0 if OK + */ + function load_state_board() + { + global $conf, $user; + + $this->nb=array(); + + $clause = "WHERE"; + + $sql = "SELECT count(f.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = "AND"; + } + $sql.= " ".$clause." f.entity = ".$conf->entity; + + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nb["supplier_invoices"]=$obj->nb; + } + $this->db->free($resql); + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } + /** * Load an object from its id and create a new one in database * diff --git a/htdocs/index.php b/htdocs/index.php index 138ddc4e3a9..ebc6760252c 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -154,7 +154,9 @@ if (empty($user->societe_id)) ! empty($conf->propal->enabled) && $user->rights->propale->lire, ! empty($conf->commande->enabled) && $user->rights->commande->lire, ! empty($conf->facture->enabled) && $user->rights->facture->lire, - ! empty($conf->contrat->enabled) && $user->rights->contrat->activer); + ! empty($conf->contrat->enabled) && $user->rights->contrat->activer, + ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire, + ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire); // Class file containing the method load_state_board for each line $includes=array(DOL_DOCUMENT_ROOT."/societe/class/client.class.php", DOL_DOCUMENT_ROOT."/comm/prospect/class/prospect.class.php", @@ -165,7 +167,9 @@ if (empty($user->societe_id)) DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php", DOL_DOCUMENT_ROOT."/commande/class/commande.class.php", DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php", - DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); + DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php", + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php", + DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.facture.class.php"); // Name class containing the method load_state_board for each line $classes=array('Client', 'Prospect', @@ -173,10 +177,12 @@ if (empty($user->societe_id)) 'Adherent', 'Product', 'Service', - 'Propal', - 'Commande', - 'Facture', - 'Contrat'); + 'Propal', + 'Commande', + 'Facture', + 'Contrat', + 'CommandeFournisseur', + 'FactureFournisseur'); // Cle array returned by the method load_state_board for each line $keys=array('customers', 'prospects', @@ -184,10 +190,12 @@ if (empty($user->societe_id)) 'members', 'products', 'services', - 'proposals', - 'orders', - 'invoices', - 'Contracts'); + 'proposals', + 'orders', + 'invoices', + 'Contracts', + 'supplier_orders', + 'supplier_invoices'); // Dashboard Icon lines $icons=array('company', 'company', @@ -195,10 +203,12 @@ if (empty($user->societe_id)) 'user', 'product', 'service', - 'propal', - 'order', - 'bill', - 'order'); + 'propal', + 'order', + 'bill', + 'order', + 'order', + 'bill'); // Translation keyword $titres=array("ThirdPartyCustomersStats", "ThirdPartyProspectsStats", @@ -209,7 +219,9 @@ if (empty($user->societe_id)) "CommercialProposalsShort", "CustomersOrders", "BillsCustomers", - "Contracts"); + "Contracts", + "SuppliersOrders", + "SuppliersInvoices"); // Dashboard Link lines $links=array(DOL_URL_ROOT.'/comm/list.php', DOL_URL_ROOT.'/comm/prospect/list.php', @@ -220,7 +232,9 @@ if (empty($user->societe_id)) DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial', DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial', DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy', - DOL_URL_ROOT.'/contrat/list.php'); + DOL_URL_ROOT.'/contrat/list.php', + DOL_URL_ROOT.'/fourn/commande/list.php', + DOL_URL_ROOT.'/fourn/facture/list.php'); // Translation lang files $langfile=array("companies", "prospects", From 26ccb79f24d6b1712672f8544e2b0585cc822502 Mon Sep 17 00:00:00 2001 From: MAxime Kohlhaas Date: Sat, 25 Oct 2014 19:13:13 +0200 Subject: [PATCH 045/171] Fix : product list was wrong on supplier invoice because fourn_id is not fetched --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index a51a6505416..353f053ebea 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -152,7 +152,7 @@ else { 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' ); - $form->select_produits_fournisseurs($object->fourn_id, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1); + $form->select_produits_fournisseurs($object->fk_soc, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1); } echo ''; } From 374b761fdf3ad7013c671aa4c1c334da921597cf Mon Sep 17 00:00:00 2001 From: MAxime Kohlhaas Date: Sat, 25 Oct 2014 19:20:02 +0200 Subject: [PATCH 046/171] Fix : product list was wrong on supplier invoice because fourn_id is not fetched --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index a51a6505416..ed06bca8725 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -152,7 +152,7 @@ else { 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' ); - $form->select_produits_fournisseurs($object->fourn_id, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1); + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1); } echo ''; } From 1405c03f7d78dc6b65d8c1880dcfde2900cf0d6d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 26 Oct 2014 06:48:08 +0100 Subject: [PATCH 047/171] Fix: Civility & birthdate wasn't save into adherent module --- ChangeLog | 11 ++++++----- htdocs/adherents/class/adherent.class.php | 13 +++++++------ htdocs/adherents/fiche.php | 5 +++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1ec979f287..cc1c3c0de2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,17 +4,18 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** -- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice -- Fix: bug 1588 : relative discount +- 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. -- Fix: right and error management #1961 -- Fix: Fix Error when trying to clone an Order #1943 +- Fix: right and error management #1961. +- Fix: Fix Error when trying to clone an Order #1943. +- Fix: Civility & birthdate wasn't save into adherent module. ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: - Fix: Can upload files on services. -- Fix: sql errors on updat fichinter. +- Fix: sql errors on update fichinter. - Fix: debian script syntax error. - Fix: error "menu param is not inside list" into pos module. - Fix: Salary payments are not reflected on the reporting sheets. diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 04056e0bbb0..0fa60a0d421 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2012 Regis Houssin + * 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 @@ -124,7 +125,7 @@ class Adherent extends CommonObject /** - * Fonction envoyant un email a l'adherent avec le texte fourni en parametre. + * Function sending an email has the adherent with the text supplied in parameter. * * @param string $text Content of message (not html entities encoded) * @param string $subject Subject of message @@ -247,9 +248,9 @@ class Adherent extends CommonObject /** - * Renvoie le libelle traduit de la nature d'un adherent (physique ou morale) + * Return translated label by the nature of a adherent (physical or moral) * - * @param string $morphy Nature physique ou morale de l'adherent + * @param string $morphy Nature of the adherent (physical or moral) * @return string Label */ function getmorphylib($morphy='') @@ -348,12 +349,12 @@ class Adherent extends CommonObject if (! $notrigger) { - // Appel des triggers + // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('MEMBER_CREATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End call triggers } if (count($this->errors)) @@ -1101,7 +1102,7 @@ class Adherent extends CommonObject $this->ref = $obj->rowid; $this->id = $obj->rowid; $this->ref_ext = $obj->ref_ext; - $this->civility_id = $obj->civility; + $this->civility_id = $obj->civility_id; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->login = $obj->login; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index cd398c75859..ef04edeeb53 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2013 Philippe Grand + * 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 @@ -707,7 +708,7 @@ else { /* ************************************************************************** */ /* */ - /* Fiche creation */ + /* Creation card */ /* */ /* ************************************************************************** */ $object->canvas=$canvas; @@ -870,7 +871,7 @@ else // Birthday print "
\n"; // Profil public From efd99a6f44003a6f8d353b2e318572cb20b0e8bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 10:20:35 +0100 Subject: [PATCH 048/171] Fix : extrafield errors --- htdocs/core/tpl/extrafields_view.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 1591ce9fb6d..d344ef5eb82 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -48,7 +48,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print '
'.$langs->trans('Margins').''.$langs->trans('SellingPrice').''.$langs->trans('Margins').''.$langs->trans('SellingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('CostPrice').''.$langs->trans('Margin').''.$langs->trans('CostPrice').''.$langs->trans('Margin').''.$langs->trans('MarginRate').'
'; + $generic_commande = new Commande($db); + $generic_product = new Product($db); + while ($i < min($num,$limit)) { + $objp = $db->fetch_object($resql); + $var=!$var; + print '
'; - $generic_commande->id=$objp->rowid; - $generic_commande->ref=$objp->ref; + $generic_commande->id=$objp->rowid; + $generic_commande->ref=$objp->ref; + $generic_commande->lines=array(); + $generic_commande->getLinesArray(); - print ''; - print ''; + print '
'; - print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); - print '
'; + print ''; + // Shippable Icon + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { + print ''; + } + + // warning late icon print ''; - // Shippable Icon + // Shipping Icon if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { print ''; - // Shipping Icon + // Shippable Icon if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { - print ''; + if ($nbprod>0) { + print ''; + } } // warning late icon From b2a9b48a78478dedaddb70293bf265db839355bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 24 Oct 2014 10:40:48 +0200 Subject: [PATCH 040/171] Update ajax.lib.php Add a delay before making request, may avoid multiple request to server when typing search request --- htdocs/core/lib/ajax.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4bc6da083aa..d6cc1a287d7 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -173,6 +173,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt } $("#search_'.$htmlname.'").trigger("change"); // To tell that input text field was modified } + ,delay: 1000 }).data( "autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) .data( "item.autocomplete", item ) From 68fa6cec70b4299aa88c6dec108132b73c5f86ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 25 Oct 2014 11:34:21 +0200 Subject: [PATCH 041/171] Update commande.php --- htdocs/admin/commande.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index e5b2e5e6b1d..89a78b5d6da 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -222,6 +222,18 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') } } +//Activate Set Shippable Icon In List +else if ($action=="setshippableiconinlist") { + $setshippableiconinlist = GETPOST('value','int'); + $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) { + setEventMessage($langs->trans("SetupSaved")); + } else { + setEventMessage($langs->trans("Error"), 'errors'); + } +} + /* * View @@ -548,6 +560,22 @@ print '' print "
    \n"; print ''; +// Shippable Icon in List +$var=!$var; +print ""; +print ''; +print ''; +print ''; +print ''; + print '
    '; + print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); + print ''; + $shippable=0; + $text_info=''; + for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) { + if ($generic_commande->lines[$lig]->product_type==0) { + $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' : '.dol_trunc($generic_commande->lines[$lig]->product_label, 28); + $generic_product->id = $generic_commande->lines[$lig]->fk_product; + $generic_product->load_stock(); + if ($generic_product->stock_reel<$generic_commande->lines[$lig]->qty) { + $shippable++; + $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + } else { + $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + } + } + } + if ($shippable==0) { + $text_icon = img_picto('', 'object_sending'); + $text_info = $langs->trans('Shippable').'
    '.$text_info; + } else { + $text_icon = img_picto('', 'error'); + $text_info = $langs->trans('NonShippable').'
    '.$text_info; + } + print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); + print '
    '; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); From 63e4275afbfc6c02f348a2e0c2503e7f166460b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 18:32:29 +0200 Subject: [PATCH 034/171] Update list.php --- htdocs/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f7c56130c2d..9fbe7f24c7f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -356,9 +356,9 @@ if ($resql) $generic_product->load_stock(); if ($generic_product->stock_reel<$generic_commande->lines[$lig]->qty) { $shippable++; - $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; } else { - $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + $text_info.='
    "; } } } From 335b0b3c56a08e40739bbf164c60b205976d8f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 18:33:52 +0200 Subject: [PATCH 035/171] Update list.php --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9fbe7f24c7f..21be169c823 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -358,7 +358,7 @@ if ($resql) $shippable++; $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; } else { - $text_info.='
    "; + $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; } } } From 48a9be28a18f322b060eb6506293329889fd2bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 18:39:12 +0200 Subject: [PATCH 036/171] Update deliveries.lang --- htdocs/langs/en_US/deliveries.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/deliveries.lang b/htdocs/langs/en_US/deliveries.lang index cabd31a3a32..b2407f610e1 100644 --- a/htdocs/langs/en_US/deliveries.lang +++ b/htdocs/langs/en_US/deliveries.lang @@ -24,3 +24,5 @@ Deliverer=Deliverer : Sender=Sender Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock +Shippable=Shippable +NonShippable=Non Shippable From ccbaba79fb12be75f9108578dd8c1b5fb9885598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Oct 2014 18:42:02 +0200 Subject: [PATCH 037/171] Update deliveries.lang --- htdocs/langs/en_US/deliveries.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/deliveries.lang b/htdocs/langs/en_US/deliveries.lang index b2407f610e1..c96a506281d 100644 --- a/htdocs/langs/en_US/deliveries.lang +++ b/htdocs/langs/en_US/deliveries.lang @@ -25,4 +25,4 @@ Sender=Sender Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock Shippable=Shippable -NonShippable=Non Shippable +NonShippable=Not Shippable From 8b4706cacd9de06cd95a7cbcf6b57560d7d6ae5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 24 Oct 2014 08:55:30 +0200 Subject: [PATCH 038/171] Update list.php --- htdocs/commande/list.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 21be169c823..ece12a159c1 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -344,25 +344,44 @@ if ($resql) print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print '
    '; - $shippable=0; + $notshippable=0; $text_info=''; for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) { if ($generic_commande->lines[$lig]->product_type==0) { - $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' : '.dol_trunc($generic_commande->lines[$lig]->product_label, 28); $generic_product->id = $generic_commande->lines[$lig]->fk_product; $generic_product->load_stock(); + // stock order and stock order_supplier + $stock_order=0; + $stock_order_supplier=0; + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + if (! empty($conf->commande->enabled)) { + $generic_product->load_stats_commande(0,'1,2'); + $stock_order=$generic_product->stats_commande['qty']; + } + if (! empty($conf->fournisseur->enabled)) { + $generic_product->load_stats_commande_fournisseur(0,'3'); + $stock_order_supplier=$generic_product->stats_commande_fournisseur['qty']; + } + } + $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25); + $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order; if ($generic_product->stock_reel<$generic_commande->lines[$lig]->qty) { - $shippable++; - $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + $notshippable++; + $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.''; } else { - $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel."
    "; + $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.''; + } + if ($stock_order_supplier>0) { + $text_info.= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'
    '; + } else { + $text_info.= '
    '; } } } - if ($shippable==0) { + if ($notshippable==0) { $text_icon = img_picto('', 'object_sending'); $text_info = $langs->trans('Shippable').'
    '.$text_info; } else { From 6a1d5edf9d14d793499d5695c63d75ee6da38ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 24 Oct 2014 09:23:39 +0200 Subject: [PATCH 039/171] Update list.php --- htdocs/commande/list.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ece12a159c1..802fe9e1f91 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -344,13 +344,14 @@ if ($resql) print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); print '
    '; $notshippable=0; $text_info=''; + $nbprod=0; for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) { if ($generic_commande->lines[$lig]->product_type==0) { + $nbprod++; // order contains real products $generic_product->id = $generic_commande->lines[$lig]->fk_product; $generic_product->load_stock(); // stock order and stock order_supplier @@ -388,8 +389,11 @@ if ($resql) $text_icon = img_picto('', 'error'); $text_info = $langs->trans('NonShippable').'
    '.$text_info; } - print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); - print '
    '; + print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); + print '
    '.$langs->trans("ShippableOrderIconInList").' '; +if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); +} else { + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); +} +print '
    '; print '
    '; From e08146d053f8793f7ca3dafa603f7568744ee6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 25 Oct 2014 11:37:39 +0200 Subject: [PATCH 042/171] Update list.php --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 802fe9e1f91..84f8e455d11 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -345,7 +345,7 @@ if ($resql) print '
    ".$langs->trans("Birthday")."\n"; - $form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc'); + $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); 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)) + if (($object->statut == 0 || $extrafields->attribute_alwayseditable[$key]) && $user->rights->{$object->element}->creer && ($action != 'edit_extras' || GETPOST('attribute') != $key)) print ''; print '
    ' . img_edit().'
    '; @@ -59,9 +59,9 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) $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) + if ($action == 'edit_extras' && $user->rights->{$object->element}->creer && GETPOST('attribute') == $key) { - print '
    '; + print ''; print ''; print ''; print ''; From 42008fcf98d7fa90dc685fad4fe3a50be637f588 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 10:22:21 +0100 Subject: [PATCH 049/171] Fix : remove associated users when company is deleted --- htdocs/societe/class/societe.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6d80189c7be..54e0edbf76a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1316,6 +1316,19 @@ class Societe extends CommonObject } } + // Remove associated users + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; + $sql.= " WHERE fk_soc = " . $id; + dol_syslog(get_class($this)."::Delete", LOG_DEBUG); + if (! $this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } + } + // Removed extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { From a5739c248ecdf19af7098582ba21641a8c8abd09 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 10:23:33 +0100 Subject: [PATCH 050/171] Fix : Product supplier prices were not working anymore due to bad SQL --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index eff9e7e4275..75ac674e877 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -467,7 +467,7 @@ class ProductFournisseur extends Product $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; $sql.= " pfp.rowid as product_fourn_price_id, pfp.ref_fourn,"; - $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.charges, pfp.unitcharges"; + $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.charges, pfp.unitcharges, "; $sql.= " pfp.remise, pfp.remise_percent"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; From fda32f663886c1dbb47f49a27c0d0bd59039af06 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 11:16:18 +0100 Subject: [PATCH 051/171] FixDosFiles --- htdocs/contact/card.php | 4 +-- htdocs/core/lib/company.lib.php | 36 ++++++++++++------------ htdocs/projet/tasks/time.php | 50 ++++++++++++++++----------------- 3 files changed, 45 insertions(+), 45 deletions(-) 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 c5ba612b60f..3dcfaff48ee 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 8b179c0d2a4402a275d2337f69d126594fd07d66 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 14:02:37 +0100 Subject: [PATCH 052/171] Fix : typo --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index af5f83cdbde..5e9179f342f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -938,7 +938,7 @@ if ($action == 'create') // Ref Int print ''.$langs->trans('RefCustomer').''; - print ''; + print ''; // Customer print ''; From 0775744b3773f710fa0083c8586187071ce87734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 27 Oct 2014 18:27:46 +0100 Subject: [PATCH 053/171] No thirdparty name in contract list --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index d89c4c144c3..dcc1b83e6d8 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -74,7 +74,7 @@ $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; $sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,'; $sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,"; -$sql.= " s.nom, s.rowid as socid"; +$sql.= " s.nom as name, s.rowid as socid"; $sql.= " ,c.ref_supplier"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; From d846dd24316acf8f9fc6fce9680b700a013a7de5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 27 Oct 2014 19:38:27 +0100 Subject: [PATCH 054/171] Fix extrafield from list feature where filter is provided --- htdocs/core/class/extrafields.class.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c9e5d937a18..16583c0703c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -743,15 +743,17 @@ class ExtraFields if (strpos($InfoFieldList[4], 'extra')!==false) { $sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra'; - $sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; } else { - $sqlwhere.= ' AND '.$InfoFieldList[4]; + $sqlwhere.= ' WHERE '.$InfoFieldList[4]; } + }else { + $sqlwhere.= ' WHERE 1'; } if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. - $sql.=preg_replace('/^ AND /','',$sqlwhere); + //$sql.=preg_replace('/^ AND /','',$sqlwhere); //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql); @@ -979,7 +981,10 @@ class ExtraFields { foreach ($fields_label as $field_toshow) { - $translabel=$langs->trans($obj->$field_toshow); + $translabel=''; + if (!empty($obj->$field_toshow)) { + $translabel=$langs->trans($obj->$field_toshow); + } if ($translabel!=$field_toshow) { $value.=dol_trunc($translabel,18).' '; }else { @@ -989,7 +994,10 @@ class ExtraFields } else { - $translabel=$langs->trans($obj->$InfoFieldList[1]); + $translabel=''; + if (!empty($obj->$InfoFieldList[1])) { + $translabel=$langs->trans($obj->$InfoFieldList[1]); + } if ($translabel!=$obj->$InfoFieldList[1]) { $value=dol_trunc($translabel,18); }else { From 834a6dc2af74a4fc482171a8e3c352acb7a54e10 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 28 Oct 2014 16:50:44 +0100 Subject: [PATCH 055/171] webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref --- ChangeLog | 1 + htdocs/webservices/server_thirdparty.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c2ad4b7ecf1..b75afb18be0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ English Dolibarr ChangeLog - Fix: right and error management #1961 - Fix: Fix Error when trying to clone an Order #1943 - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode +- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c5ac0c8c686..4a295cd3bfa 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -460,7 +460,7 @@ function createThirdParty($authentication,$thirdparty) $result=$newobject->create($fuser); if ($newobject->particulier && $result > 0) { $newobject->firstname = $thirdparty['firstname']; - $newobject->name_bis = $thirdparty['ref']; + $newobject->name_bis = $thirdparty['lastname']; $result = $newobject->create_individual($fuser); } if ($result <= 0) From a32817db9d0088e56be192bc76519f0b8214135f Mon Sep 17 00:00:00 2001 From: jfefe Date: Tue, 28 Oct 2014 23:49:54 +0100 Subject: [PATCH 056/171] Update makepack-dolibarr.pl : indentation --- build/makepack-dolibarr.pl | 1416 ++++++++++++++++++------------------ 1 file changed, 708 insertions(+), 708 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 0e8f2ea0fdd..3f637ef856e 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -63,19 +63,19 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; $PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/files"; if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"}) { - print "Error: Missing environment variables.\n"; + print "Error: Missing environment variables.\n"; print "You must define the environment variable DESTIBETARC and DESTISTABLE to point to the\ndirectories where you want to save the generated packages.\n"; print "Example: DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'\n"; print "Example: DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'\n"; print "$PROG.$Extension aborted.\n"; - sleep 2; + sleep 2; exit 1; } if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"}) { - print "Error: Directory of environment variable DESTIBETARC or DESTISTABLE does not exist.\n"; + print "Error: Directory of environment variable DESTIBETARC or DESTISTABLE does not exist.\n"; print "$PROG.$Extension aborted.\n"; - sleep 2; + sleep 2; exit 1; } @@ -85,31 +85,31 @@ if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS=' elsif (-d "/etc" && -d "/Users") { $OS='macosx'; $CR=''; } elsif ("$^O" =~ /cygwin/i || "$^O" =~ /win32/i) { $OS='windows'; $CR="\r"; } if (! $OS) { - print "Error: Can't detect your OS.\n"; + print "Error: Can't detect your OS.\n"; print "Can't continue.\n"; print "$PROG.$Extension aborted.\n"; - sleep 2; + sleep 2; exit 1; } # Define buildroot # ---------------- if ($OS =~ /linux/) { - $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp"; + $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp"; } if ($OS =~ /macos/) { - $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp"; + $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"/tmp"; } if ($OS =~ /windows/) { - $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"c:/temp"; - $PROGPATH=$ENV{"ProgramFiles"}; + $TEMP=$ENV{"TEMP"}||$ENV{"TMP"}||"c:/temp"; + $PROGPATH=$ENV{"ProgramFiles"}; } if (! $TEMP || ! -d $TEMP) { - print "Error: A temporary directory can not be find.\n"; - print "Check that TEMP or TMP environment variable is set correctly.\n"; + print "Error: A temporary directory can not be find.\n"; + print "Check that TEMP or TMP environment variable is set correctly.\n"; print "$PROG.$Extension aborted.\n"; - sleep 2; - exit 2; + sleep 2; + exit 2; } $BUILDROOT="$TEMP/buildroot"; @@ -169,10 +169,10 @@ my $batch=0; for (0..@ARGV-1) { if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; } if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; } - if ($ARGV[$_] =~ /^-*prefix=(.+)/i) { - $PREFIX=$1; - $FILENAMESNAPSHOT.="-".$PREFIX; - } + if ($ARGV[$_] =~ /^-*prefix=(.+)/i) { + $PREFIX=$1; + $FILENAMESNAPSHOT.="-".$PREFIX; + } } if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTISTABLE is defined @@ -192,7 +192,7 @@ print "Target directory (DESTI) : $DESTI\n"; if ($target) { if ($target eq "ALL") { foreach my $key (@LISTETARGET) { - if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; } + if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; } } } if ($target ne "ALL" && $target ne "SF" && $target ne "ASSO") { $CHOOSEDTARGET{uc($target)}=1; } @@ -200,56 +200,56 @@ if ($target) { if ($target eq "ASSO") { $CHOOSEDPUBLISH{"ASSO"}=1; } } else { - my $found=0; - my $NUM_SCRIPT; - my $cpt=0; - while (! $found) { - printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET)); - foreach my $target (@LISTETARGET) { - $cpt++; - printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); - } - $cpt=98; - printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); - $cpt=99; - printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); - - # Ask which target to build - print "Choose one package number or several separated with space (0 - ".$cpt."): "; - $NUM_SCRIPT=; - chomp($NUM_SCRIPT); - if ($NUM_SCRIPT !~ /^[0-9\s]+$/) - { - print "This is not a valid package number list.\n"; - $found = 0; - } - else - { - $found = 1; - } - } - print "\n"; - if ($NUM_SCRIPT eq "98") { - $CHOOSEDPUBLISH{"ASSO"}=1; - } - else - { - if ($NUM_SCRIPT eq "99") { - $CHOOSEDPUBLISH{"SF"}=1; - } - else { - if ($NUM_SCRIPT eq "0") { - foreach my $key (@LISTETARGET) { - if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; } - } - } - else { - foreach my $num (split(/\s+/,$NUM_SCRIPT)) { - $CHOOSEDTARGET{$LISTETARGET[$num-1]}=1; - } - } - } - } + my $found=0; + my $NUM_SCRIPT; + my $cpt=0; + while (! $found) { + printf(" %2d - %-14s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET)); + foreach my $target (@LISTETARGET) { + $cpt++; + printf(" %2d - %-14s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); + } + $cpt=98; + printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); + $cpt=99; + printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH)); + + # Ask which target to build + print "Choose one package number or several separated with space (0 - ".$cpt."): "; + $NUM_SCRIPT=; + chomp($NUM_SCRIPT); + if ($NUM_SCRIPT !~ /^[0-9\s]+$/) + { + print "This is not a valid package number list.\n"; + $found = 0; + } + else + { + $found = 1; + } + } + print "\n"; + if ($NUM_SCRIPT eq "98") { + $CHOOSEDPUBLISH{"ASSO"}=1; + } + else + { + if ($NUM_SCRIPT eq "99") { + $CHOOSEDPUBLISH{"SF"}=1; + } + else { + if ($NUM_SCRIPT eq "0") { + foreach my $key (@LISTETARGET) { + if ($key ne 'SNAPSHOT' && $key ne 'ASSO' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; } + } + } + else { + foreach my $num (split(/\s+/,$NUM_SCRIPT)) { + $CHOOSEDTARGET{$LISTETARGET[$num-1]}=1; + } + } + } + } } # Test if requirement is ok @@ -265,34 +265,34 @@ foreach my $target (keys %CHOOSEDTARGET) { } $atleastonerpm=1; } - foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) - { - # Test - print "Test requirement for target $target: Search '$req'... "; - $newreq=$req; $newparam=''; - if ($newreq eq 'zip') { $newparam.='-h'; } - if ($newreq eq 'xz') { $newparam.='-h'; } - $cmd="\"$newreq\" $newparam 2>&1"; - print "Test command ".$cmd."... "; - $ret=`$cmd`; - $coderetour=$?; $coderetour2=$coderetour>>8; - if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) { - # Not found error, we try in PROGPATH - $ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`; - $coderetour=$?; $coderetour2=$coderetour>>8; - $REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req"; - } + foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) + { + # Test + print "Test requirement for target $target: Search '$req'... "; + $newreq=$req; $newparam=''; + if ($newreq eq 'zip') { $newparam.='-h'; } + if ($newreq eq 'xz') { $newparam.='-h'; } + $cmd="\"$newreq\" $newparam 2>&1"; + print "Test command ".$cmd."... "; + $ret=`$cmd`; + $coderetour=$?; $coderetour2=$coderetour>>8; + if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) { + # Not found error, we try in PROGPATH + $ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`; + $coderetour=$?; $coderetour2=$coderetour>>8; + $REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req"; + } - if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) { - # Not found error - print "Not found\nCan't build target $target. Requirement '$req' not found in PATH\n"; - $CHOOSEDTARGET{$target}=-1; - last; - } else { - # Pas erreur ou erreur autre que programme absent - print " Found ".$req."\n"; - } - } + if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) { + # Not found error + print "Not found\nCan't build target $target. Requirement '$req' not found in PATH\n"; + $CHOOSEDTARGET{$target}=-1; + last; + } else { + # Pas erreur ou erreur autre que programme absent + print " Found ".$req."\n"; + } + } } print "\n"; @@ -303,7 +303,7 @@ $nboftargetok=0; $nboftargetneedbuildroot=0; $nbofpublishneedtag=0; foreach my $target (keys %CHOOSEDTARGET) { - if ($CHOOSEDTARGET{$target} < 0) { next; } + if ($CHOOSEDTARGET{$target} < 0) { next; } if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP') { $nboftargetneedbuildroot++; @@ -311,7 +311,7 @@ foreach my $target (keys %CHOOSEDTARGET) { $nboftargetok++; } foreach my $target (keys %CHOOSEDPUBLISH) { - if ($CHOOSEDPUBLISH{$target} < 0) { next; } + if ($CHOOSEDPUBLISH{$target} < 0) { next; } if ($target eq 'ASSO') { $nbofpublishneedtag++; } if ($target eq 'SF') { $nbofpublishneedtag++; } $nboftargetok++; @@ -319,714 +319,714 @@ foreach my $target (keys %CHOOSEDPUBLISH) { if ($nboftargetok) { - # Update CVS if required - #----------------------- - if ($nbofpublishneedtag) + # Update CVS if required + #----------------------- + if ($nbofpublishneedtag) { - print "Go to directory $SOURCE\n"; - $olddir=getcwd(); - chdir("$SOURCE"); - print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; - $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; - if ($ret =~ /already exists/) - { - print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? "; - $QUESTIONOVERWRITETAG=; - chomp($QUESTIONOVERWRITETAG); - if ($QUESTIONOVERWRITETAG =~ /(o|y)/) - { - print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; - $ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`; - } - } - print 'Run git push --tags'."\n"; - $ret=`git push --tags`; - chdir("$olddir"); + print "Go to directory $SOURCE\n"; + $olddir=getcwd(); + chdir("$SOURCE"); + print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; + $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; + if ($ret =~ /already exists/) + { + print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? "; + $QUESTIONOVERWRITETAG=; + chomp($QUESTIONOVERWRITETAG); + if ($QUESTIONOVERWRITETAG =~ /(o|y)/) + { + print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; + $ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`; + } + } + print 'Run git push --tags'."\n"; + $ret=`git push --tags`; + chdir("$olddir"); } - # Update buildroot if required - #----------------------------- - if ($nboftargetneedbuildroot) + # Update buildroot if required + #----------------------------- + if ($nboftargetneedbuildroot) { - if (! $copyalreadydone) { - print "Creation of a buildroot used for all packages\n"; + if (! $copyalreadydone) { + print "Creation of a buildroot used for all packages\n"; - print "Delete directory $BUILDROOT\n"; - $ret=`rm -fr "$BUILDROOT"`; - - mkdir "$BUILDROOT"; - mkdir "$BUILDROOT/$PROJECT"; - print "Copy $SOURCE into $BUILDROOT/$PROJECT\n"; - $ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`; + print "Delete directory $BUILDROOT\n"; + $ret=`rm -fr "$BUILDROOT"`; + + mkdir "$BUILDROOT"; + mkdir "$BUILDROOT/$PROJECT"; + print "Copy $SOURCE into $BUILDROOT/$PROJECT\n"; + $ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`; - #print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n"; - #$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`; - } - print "Clean $BUILDROOT\n"; - $ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.git*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.project`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.scrutinizer.yml`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.tx`; - $ret=`rm -f $BUILDROOT/$PROJECT/build.xml`; - $ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`; - $ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`; - - $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; - $ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; + #print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n"; + #$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`; + } + print "Clean $BUILDROOT\n"; + $ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.git*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.project`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.scrutinizer.yml`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.tx`; + $ret=`rm -f $BUILDROOT/$PROJECT/build.xml`; + $ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`; + $ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`; + + $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; + $ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/initdata`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/iso-normes`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/ldap`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/mail`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpcheckstyle`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpunit`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/security`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/vagrant`; - $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`; - $ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`; - $ret=`rm -f $BUILDROOT/$PROJECT/dev/README`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot2.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot3.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot4.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot5.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot6.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot7.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot8.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot9.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot10.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`; - $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/initdata`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/iso-normes`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/ldap`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/licence`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/mail`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpcheckstyle`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/phpunit`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/security`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/spec`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/uml`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/vagrant`; + $ret=`rm -fr $BUILDROOT/$PROJECT/dev/xdebug`; + $ret=`rm -f $BUILDROOT/$PROJECT/dev/dolibarr_changes.txt`; + $ret=`rm -f $BUILDROOT/$PROJECT/dev/README`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot2.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot3.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot4.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot5.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot6.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot7.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot8.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot9.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot10.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`; + $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`; - $ret=`rm -fr $BUILDROOT/$PROJECT/document`; - $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/test`; - $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; - $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; - $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries - #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball - - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`; + $ret=`rm -fr $BUILDROOT/$PROJECT/document`; + $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; + $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; + $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries + #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball + + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`; } - # Build package for each target - #------------------------------ - foreach my $target (keys %CHOOSEDTARGET) - { - if ($CHOOSEDTARGET{$target} < 0) { next; } - - print "\nBuild package for target $target\n"; + # Build package for each target + #------------------------------ + foreach my $target (keys %CHOOSEDTARGET) + { + if ($CHOOSEDTARGET{$target} < 0) { next; } + + print "\nBuild package for target $target\n"; - if ($target eq 'SNAPSHOT') - { - $NEWDESTI=$DESTI; + if ($target eq 'SNAPSHOT') + { + $NEWDESTI=$DESTI; - print "Remove target $FILENAMESNAPSHOT.tgz...\n"; - unlink("$NEWDESTI/$FILENAMESNAPSHOT.tgz"); + print "Remove target $FILENAMESNAPSHOT.tgz...\n"; + unlink("$NEWDESTI/$FILENAMESNAPSHOT.tgz"); - #rmdir "$BUILDROOT/$FILENAMESNAPSHOT"; - $ret=`rm -fr $BUILDROOT/$FILENAMESNAPSHOT`; - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMESNAPSHOT\""; - $ret=`$cmd`; + #rmdir "$BUILDROOT/$FILENAMESNAPSHOT"; + $ret=`rm -fr $BUILDROOT/$FILENAMESNAPSHOT`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMESNAPSHOT\""; + $ret=`$cmd`; - print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n"; - $cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT"; + print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n"; + $cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT"; print $cmd."\n"; $ret=`$cmd`; - # Move to final dir - print "Move $FILENAMESNAPSHOT.tgz to $NEWDESTI/$FILENAMESNAPSHOT.tgz\n"; - $ret=`mv "$FILENAMESNAPSHOT.tgz" "$NEWDESTI/$FILENAMESNAPSHOT.tgz"`; - next; - } + # Move to final dir + print "Move $FILENAMESNAPSHOT.tgz to $NEWDESTI/$FILENAMESNAPSHOT.tgz\n"; + $ret=`mv "$FILENAMESNAPSHOT.tgz" "$NEWDESTI/$FILENAMESNAPSHOT.tgz"`; + next; + } - if ($target eq 'TGZ') - { - $NEWDESTI=$DESTI; - mkdir($DESTI.'/standard'); + if ($target eq 'TGZ') + { + $NEWDESTI=$DESTI; + mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } - print "Remove target $FILENAMETGZ.tgz...\n"; - unlink("$NEWDESTI/$FILENAMETGZ.tgz"); + print "Remove target $FILENAMETGZ.tgz...\n"; + unlink("$NEWDESTI/$FILENAMETGZ.tgz"); - #rmdir "$BUILDROOT/$FILENAMETGZ"; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ`; - print "Copy $BUILDROOT/$PROJECT/ to $BUILDROOT/$FILENAMETGZ\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT/\" \"$BUILDROOT/$FILENAMETGZ\""; - $ret=`$cmd`; + #rmdir "$BUILDROOT/$FILENAMETGZ"; + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ`; + print "Copy $BUILDROOT/$PROJECT/ to $BUILDROOT/$FILENAMETGZ\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT/\" \"$BUILDROOT/$FILENAMETGZ\""; + $ret=`$cmd`; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages - print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n"; - $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ"; - print "$cmd\n"; - $ret=`$cmd`; + print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n"; + $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ"; + print "$cmd\n"; + $ret=`$cmd`; - # Move to final dir - print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; - $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; - next; - } + # Move to final dir + print "Move $BUILDROOT/$FILENAMETGZ.tgz to $NEWDESTI/$FILENAMETGZ.tgz\n"; + $ret=`mv "$BUILDROOT/$FILENAMETGZ.tgz" "$NEWDESTI/$FILENAMETGZ.tgz"`; + next; + } - if ($target eq 'XZ') - { - $NEWDESTI=$DESTI; - mkdir($DESTI.'/standard'); + if ($target eq 'XZ') + { + $NEWDESTI=$DESTI; + mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } - print "Remove target $FILENAMEXZ.xz...\n"; - unlink("$NEWDESTI/$FILENAMEXZ.xz"); + print "Remove target $FILENAMEXZ.xz...\n"; + unlink("$NEWDESTI/$FILENAMEXZ.xz"); - #rmdir "$BUILDROOT/$FILENAMEXZ"; - $ret=`rm -fr $BUILDROOT/$FILENAMEXZ`; - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEXZ\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEXZ\""; - $ret=`$cmd`; + #rmdir "$BUILDROOT/$FILENAMEXZ"; + $ret=`rm -fr $BUILDROOT/$FILENAMEXZ`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEXZ\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEXZ\""; + $ret=`$cmd`; - $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`; $ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages - print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n"; - - print "Go to directory $BUILDROOT\n"; - $olddir=getcwd(); - chdir("$BUILDROOT"); - $cmd= "xz -9 -r $BUILDROOT/$FILENAMEAPS.xz \*"; + print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n"; + + print "Go to directory $BUILDROOT\n"; + $olddir=getcwd(); + chdir("$BUILDROOT"); + $cmd= "xz -9 -r $BUILDROOT/$FILENAMEAPS.xz \*"; print $cmd."\n"; $ret= `$cmd`; - chdir("$olddir"); + chdir("$olddir"); - # Move to final dir - print "Move $FILENAMEXZ.xz to $NEWDESTI/$FILENAMEXZ.xz\n"; - $ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`; - next; - } - - if ($target eq 'ZIP') - { - $NEWDESTI=$DESTI; - mkdir($DESTI.'/standard'); + # Move to final dir + print "Move $FILENAMEXZ.xz to $NEWDESTI/$FILENAMEXZ.xz\n"; + $ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`; + next; + } + + if ($target eq 'ZIP') + { + $NEWDESTI=$DESTI; + mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } - print "Remove target $FILENAMEZIP.zip...\n"; - unlink("$NEWDESTI/$FILENAMEZIP.zip"); + print "Remove target $FILENAMEZIP.zip...\n"; + unlink("$NEWDESTI/$FILENAMEZIP.zip"); - #rmdir "$BUILDROOT/$FILENAMEZIP"; - $ret=`rm -fr $BUILDROOT/$FILENAMEZIP`; - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEZIP\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEZIP\""; - $ret=`$cmd`; + #rmdir "$BUILDROOT/$FILENAMEZIP"; + $ret=`rm -fr $BUILDROOT/$FILENAMEZIP`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEZIP\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$FILENAMEZIP\""; + $ret=`$cmd`; - $ret=`rm -fr $BUILDROOT/$FILENAMEZIP/build/exe`; + $ret=`rm -fr $BUILDROOT/$FILENAMEZIP/build/exe`; $ret=`rm -fr $BUILDROOT/$FILENAMEZIP/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages - print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n"; - - print "Go to directory $BUILDROOT\n"; - $olddir=getcwd(); - chdir("$BUILDROOT"); - $cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\/*"; + print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n"; + + print "Go to directory $BUILDROOT\n"; + $olddir=getcwd(); + chdir("$BUILDROOT"); + $cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\/*"; print $cmd."\n"; $ret= `$cmd`; - chdir("$olddir"); - - # Move to final dir - print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n"; - $ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`; - next; - } - - if ($target =~ /RPM/) # Linux only - { - $NEWDESTI=$DESTI; - $subdir="package_rpm_generic"; - if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; } - if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; } - if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; } - mkdir($DESTI.'/'.$subdir); + chdir("$olddir"); + + # Move to final dir + print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n"; + $ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`; + next; + } + + if ($target =~ /RPM/) # Linux only + { + $NEWDESTI=$DESTI; + $subdir="package_rpm_generic"; + if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; } + if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; } + if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; } + mkdir($DESTI.'/'.$subdir); if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; } if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; } - print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; + print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; - print "Remove target ".$FILENAMERPM."...\n"; - unlink("$NEWDESTI/".$FILENAMERPM); - print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; - unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm"); + print "Remove target ".$FILENAMERPM."...\n"; + unlink("$NEWDESTI/".$FILENAMERPM); + print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; + unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm"); - print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; - - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; - $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; - $ret=`$cmd`; + print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; + + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; + $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; + $ret=`$cmd`; - # Removed files we don't need - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; - $cmd="find $BUILDROOT/$FILENAMETGZ2 -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; + $cmd="find $BUILDROOT/$FILENAMETGZ2 -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; # Build tgz - print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n"; - $ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`; + print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n"; + $ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`; - print "Move $BUILDROOT/$FILENAMETGZ2.tgz to $RPMDIR/SOURCES/$FILENAMETGZ2.tgz\n"; - $cmd="mv $BUILDROOT/$FILENAMETGZ2.tgz $RPMDIR/SOURCES/$FILENAMETGZ2.tgz"; - $ret=`$cmd`; + print "Move $BUILDROOT/$FILENAMETGZ2.tgz to $RPMDIR/SOURCES/$FILENAMETGZ2.tgz\n"; + $cmd="mv $BUILDROOT/$FILENAMETGZ2.tgz $RPMDIR/SOURCES/$FILENAMETGZ2.tgz"; + $ret=`$cmd`; - $BUILDFIC="${FILENAME}.spec"; - $BUILDFICSRC="${FILENAME}_generic.spec"; - if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; } - if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; } - if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; } - - print "Generate file $BUILDROOT/$BUILDFIC from $SOURCE/build/rpm/${BUILDFICSRC}\n"; - open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFICSRC}") || die "Error"; - open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error"; - while () { - $_ =~ s/__FILENAMETGZ__/$FILENAMETGZ/; - $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/; - $_ =~ s/__RELEASE__/$RPMSUBVERSION/; - print SPECTO $_; - } - close SPECFROM; - close SPECTO; - - print "Copy patch file to $RPMDIR/SOURCES\n"; - $ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`; - $ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`; + $BUILDFIC="${FILENAME}.spec"; + $BUILDFICSRC="${FILENAME}_generic.spec"; + if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; } + if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; } + if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; } + + print "Generate file $BUILDROOT/$BUILDFIC from $SOURCE/build/rpm/${BUILDFICSRC}\n"; + open (SPECFROM,"<$SOURCE/build/rpm/${BUILDFICSRC}") || die "Error"; + open (SPECTO,">$BUILDROOT/$BUILDFIC") || die "Error"; + while () { + $_ =~ s/__FILENAMETGZ__/$FILENAMETGZ/; + $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/; + $_ =~ s/__RELEASE__/$RPMSUBVERSION/; + print SPECTO $_; + } + close SPECFROM; + close SPECTO; + + print "Copy patch file to $RPMDIR/SOURCES\n"; + $ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`; + $ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`; - print "Launch RPM build (rpmbuild --clean -ba $BUILDROOT/${BUILDFIC})\n"; - #$ret=`rpmbuild -vvvv --clean -ba $BUILDROOT/${BUILDFIC}`; - $ret=`rpmbuild --clean -ba $BUILDROOT/${BUILDFIC}`; + print "Launch RPM build (rpmbuild --clean -ba $BUILDROOT/${BUILDFIC})\n"; + #$ret=`rpmbuild -vvvv --clean -ba $BUILDROOT/${BUILDFIC}`; + $ret=`rpmbuild --clean -ba $BUILDROOT/${BUILDFIC}`; - # Move to final dir - print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n"; - $cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\""; - $ret=`$cmd`; - print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n"; - $cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\""; - $ret=`$cmd`; - print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n"; - $cmd="mv \"$RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz\" \"$NEWDESTI/".$FILENAMETGZ2.".tgz\""; - $ret=`$cmd`; - next; - } + # Move to final dir + print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n"; + $cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\""; + $ret=`$cmd`; + print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n"; + $cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\""; + $ret=`$cmd`; + print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n"; + $cmd="mv \"$RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz\" \"$NEWDESTI/".$FILENAMETGZ2.".tgz\""; + $ret=`$cmd`; + next; + } - if ($target eq 'DEB') - { - $NEWDESTI=$DESTI; - mkdir($DESTI.'/package_debian-ubuntu'); + if ($target eq 'DEB') + { + $NEWDESTI=$DESTI; + mkdir($DESTI.'/package_debian-ubuntu'); if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; } - $olddir=getcwd(); + $olddir=getcwd(); - print "Remove target ${FILENAMEDEB}_all.deb...\n"; - unlink("$NEWDESTI/${FILENAMEDEB}_all.deb"); - print "Remove target ${FILENAMEDEB}.dsc...\n"; - unlink("$NEWDESTI/${FILENAMEDEB}.dsc"); - print "Remove target ${FILENAMEDEB}.tar.gz...\n"; - unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz"); - print "Remove target ${FILENAMEDEB}.changes...\n"; - unlink("$NEWDESTI/${FILENAMEDEB}.changes"); - print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n"; - unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz"); - print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n"; - unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz"); + print "Remove target ${FILENAMEDEB}_all.deb...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}_all.deb"); + print "Remove target ${FILENAMEDEB}.dsc...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.dsc"); + print "Remove target ${FILENAMEDEB}.tar.gz...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz"); + print "Remove target ${FILENAMEDEB}.changes...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.changes"); + print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n"; + unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz"); + print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n"; + unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz"); - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`; - $ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`; - + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`; + $ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n"; $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; $ret=`$cmd`; $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/debian/apache/.htaccess\" \"$BUILDROOT/$PROJECT.tmp/build/debian/apache/.htaccess\""; $ret=`$cmd`; - print "Remove other files\n"; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/dmg`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/pad/README`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/tgz/README`; - #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/po`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/source`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/changelog`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/compat`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/control*`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/copyright`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.config`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.desktop`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.docs`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.install`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.lintian-overrides`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postrm`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postinst`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.Debian`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/live`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/patch`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; - # Removed duplicate license files - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`; - # Removed files we don't need - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`; - - # Rename upstream changelog to match debian rules + print "Remove other files\n"; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/dmg`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/pad/README`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/tgz/README`; + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/po`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/debian/source`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/changelog`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/compat`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/control*`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/copyright`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.config`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.desktop`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.docs`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.install`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.lintian-overrides`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postrm`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postinst`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.Debian`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/live`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/patch`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; + # Removed duplicate license files + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`; + # Removed files we don't need + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`; + + # Rename upstream changelog to match debian rules $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; - # Prepare source package (init debian dir) - print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; - $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; - print "Copy $SOURCE/build/debian/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; - # Add files for dpkg-source - $ret=`cp -f "$SOURCE/build/debian/changelog" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/compat" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/control" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/copyright" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.docs" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.install" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -fr "$SOURCE/build/debian/apache" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; - $ret=`cp -f "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; - $ret=`cp -fr "$SOURCE/build/debian/lighttpd" "$BUILDROOT/$PROJECT.tmp/debian/lighttpd"`; - # Add files also required to build binary package - $ret=`cp -f "$SOURCE/build/debian/dolibarr.config" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`; - + # Prepare source package (init debian dir) + print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n"; + $ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`; + print "Copy $SOURCE/build/debian/xxx to $BUILDROOT/$PROJECT.tmp/debian\n"; + # Add files for dpkg-source + $ret=`cp -f "$SOURCE/build/debian/changelog" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/compat" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/control" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/copyright" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.docs" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.install" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -fr "$SOURCE/build/debian/apache" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; + $ret=`cp -f "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT.tmp/debian/apache"`; + $ret=`cp -fr "$SOURCE/build/debian/lighttpd" "$BUILDROOT/$PROJECT.tmp/debian/lighttpd"`; + # Add files also required to build binary package + $ret=`cp -f "$SOURCE/build/debian/dolibarr.config" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.postinst" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`; + # Set owners and permissions - #print "Set owners on files/dir\n"; - #$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; + #print "Set owners on files/dir\n"; + #$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`; - print "Set permissions on files/dir\n"; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; - $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.dpatch' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.pl' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/dev -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/modMyModule.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_class.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_page.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; - $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; "; - $ret=`$cmd`; - - - print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; - $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; - $ret=`$cmd`; + print "Set permissions on files/dir\n"; + $ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`; + $cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.php' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.dpatch' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/build -name '*.pl' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/dev -name '*.php' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/modMyModule.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_class.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_page.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; + $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; + + + print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; + $cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; + $ret=`$cmd`; - print "Go into directory $BUILDROOT\n"; - chdir("$BUILDROOT"); + print "Go into directory $BUILDROOT\n"; + chdir("$BUILDROOT"); # We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native) - print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n"; - $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build"; - print $cmd."\n"; - $ret=`$cmd`; + print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n"; + $cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build"; + print $cmd."\n"; + $ret=`$cmd`; # Creation of source package - print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; - chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"); - #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; - $cmd="dpkg-buildpackage -us -uc"; - print "Launch DEB build ($cmd)\n"; - $ret=`$cmd 2>&1 3>&1`; - print $ret."\n"; + print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; + chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"); + #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; + $cmd="dpkg-buildpackage -us -uc"; + print "Launch DEB build ($cmd)\n"; + $ret=`$cmd 2>&1 3>&1`; + print $ret."\n"; - chdir("$olddir"); - - print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n"; - print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n"; - - # Move to final dir - print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n"; - $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; - $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; - next; - } - - if ($target eq 'APS') - { + chdir("$olddir"); + + print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n"; + print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n"; + + # Move to final dir + print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n"; + $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`; + $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`; + next; + } + + if ($target eq 'APS') + { $NEWDESTI=$DESTI; - mkdir($DESTI.'/package_aps'); + mkdir($DESTI.'/package_aps'); if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; } - $newbuild = $BUILD; - $newbuild =~ s/(dev|alpha)/0/gi; # dev - $newbuild =~ s/beta/1/gi; # beta - $newbuild =~ s/rc./2/gi; # rc - if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale - # now newbuild is 0-0 or 0-3 for example - $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; - if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } - print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; - - print "Remove target $FILENAMEAPS.zip...\n"; - unlink "$NEWDESTI/$FILENAMEAPS.zip"; - - #rmdir "$BUILDROOT/$PROJECT.tmp"; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`; - print "Create directory $BUILDROOT/$PROJECT.tmp\n"; - $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp"`; - print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n"; - $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; - $ret=`$cmd`; + $newbuild = $BUILD; + $newbuild =~ s/(dev|alpha)/0/gi; # dev + $newbuild =~ s/beta/1/gi; # beta + $newbuild =~ s/rc./2/gi; # rc + if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale + # now newbuild is 0-0 or 0-3 for example + $REL1 = $newbuild; $REL1 =~ s/-.*$//gi; + if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; } + print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; + + print "Remove target $FILENAMEAPS.zip...\n"; + unlink "$NEWDESTI/$FILENAMEAPS.zip"; - print "Remove other files\n"; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`; + #rmdir "$BUILDROOT/$PROJECT.tmp"; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`; + print "Create directory $BUILDROOT/$PROJECT.tmp\n"; + $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp"`; + print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n"; + $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\""; + $ret=`$cmd`; - $APSVERSION="1.2"; - print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n"; - open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error"; - open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error"; - while () { - $newbuild = $BUILD; - $newbuild =~ s/(dev|alpha)/0/gi; # dev - $newbuild =~ s/beta/1/gi; # beta - $newbuild =~ s/rc./2/gi; # rc - if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale - # now newbuild is 0-0 or 0-3 for example - $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/; - $_ =~ s/__RELEASE__/$RPMSUBVERSION/; - print SPECTO $_; - } - close SPECFROM; - close SPECTO; - print "Version set to $MAJOR.$MINOR.$newbuild\n"; - #$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\""; - #$ret=`$cmd`; - $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\""; - $ret=`$cmd`; - $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\""; - $ret=`$cmd`; - - print "Remove other files\n"; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`; - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`; - - print "Build APP-LIST.xml files\n"; - - print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n"; - - print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n"; - $olddir=getcwd(); - chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT"); - $cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*"; - print $cmd."\n"; - $ret= `$cmd`; - chdir("$olddir"); - - # Move to final dir - print "Move $BUILDROOT/$FILENAMEAPS.zip to $NEWDESTI/$FILENAMEAPS.zip\n"; - $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$NEWDESTI/$FILENAMEAPS.zip"`; - next; - } + print "Remove other files\n"; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`; - if ($target eq 'EXEDOLIWAMP') - { - $NEWDESTI=$DESTI; - mkdir($DESTI.'/package_windows'); + $APSVERSION="1.2"; + print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n"; + open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error"; + open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error"; + while () { + $newbuild = $BUILD; + $newbuild =~ s/(dev|alpha)/0/gi; # dev + $newbuild =~ s/beta/1/gi; # beta + $newbuild =~ s/rc./2/gi; # rc + if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale + # now newbuild is 0-0 or 0-3 for example + $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/; + $_ =~ s/__RELEASE__/$RPMSUBVERSION/; + print SPECTO $_; + } + close SPECFROM; + close SPECTO; + print "Version set to $MAJOR.$MINOR.$newbuild\n"; + #$cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure\""; + #$ret=`$cmd`; + $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\""; + $ret=`$cmd`; + $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\""; + $ret=`$cmd`; + + print "Remove other files\n"; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`; + $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`; + + print "Build APP-LIST.xml files\n"; + + print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n"; + + print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n"; + $olddir=getcwd(); + chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT"); + $cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*"; + print $cmd."\n"; + $ret= `$cmd`; + chdir("$olddir"); + + # Move to final dir + print "Move $BUILDROOT/$FILENAMEAPS.zip to $NEWDESTI/$FILENAMEAPS.zip\n"; + $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$NEWDESTI/$FILENAMEAPS.zip"`; + next; + } + + if ($target eq 'EXEDOLIWAMP') + { + $NEWDESTI=$DESTI; + mkdir($DESTI.'/package_windows'); if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; } - - print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n"; - unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; - - $SOURCEBACK=$SOURCE; - $SOURCEBACK =~ s/\//\\/g; - print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; - $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\""; + + print "Remove target $FILENAMEEXEDOLIWAMP.exe...\n"; + unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"; + + $SOURCEBACK=$SOURCE; + $SOURCEBACK =~ s/\//\\/g; + print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n"; + $cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\""; print "$cmd\n"; $ret= `$cmd`; #print "$ret\n"; - # Move to final dir + # Move to final dir print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; - rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); - print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; - $ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; - next; - } - } + rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"); + print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n"; + $ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`; + next; + } + } - # Publish package for each target - #-------------------------------- - foreach my $target (keys %CHOOSEDPUBLISH) - { - if ($CHOOSEDPUBLISH{$target} < 0) { next; } - + # Publish package for each target + #-------------------------------- + foreach my $target (keys %CHOOSEDPUBLISH) + { + if ($CHOOSEDPUBLISH{$target} < 0) { next; } + print "\nList of files to publish\n"; - %filestoscansf=( - "$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)', - "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', - "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', - "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', - "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' - ); - use POSIX qw/strftime/; - foreach my $file (sort keys %filestoscansf) - { - $found=0; - my $filesize = -s $file; - my $filedate = (stat $file)[9]; - print $file." ".($filesize?"(found)":"(not found)"); - print ($filesize?" - ".$filesize:""); - print ($filedate?" - ".strftime("%Y-%m-%d %H:%M:%S",localtime($filedate)):""); - print "\n"; - } + %filestoscansf=( + "$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)', + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', + "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)', + "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', + "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' + ); + use POSIX qw/strftime/; + foreach my $file (sort keys %filestoscansf) + { + $found=0; + my $filesize = -s $file; + my $filedate = (stat $file)[9]; + print $file." ".($filesize?"(found)":"(not found)"); + print ($filesize?" - ".$filesize:""); + print ($filedate?" - ".strftime("%Y-%m-%d %H:%M:%S",localtime($filedate)):""); + print "\n"; + } - if ($target eq 'SF' || $target eq 'ASSO') - { - print "\n"; - - if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; } + if ($target eq 'SF' || $target eq 'ASSO') + { + print "\n"; + + if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; } if ($target eq 'ASSO' && $BUILD =~ /[a-z]/i) { $PUBLISH = $PUBLISHBETARC.'/lastbuild'; } if ($target eq 'ASSO' && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $PUBLISHBETARC.'/stable'; } - $NEWPUBLISH=$PUBLISH; - print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n"; + $NEWPUBLISH=$PUBLISH; + print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n"; - # Ask which target to build - $NUM_SCRIPT=; - chomp($NUM_SCRIPT); + # Ask which target to build + $NUM_SCRIPT=; + chomp($NUM_SCRIPT); print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n"; - $ret=`mkdir -p "/tmp/emptydir/"`; - - %filestoscan=%filestoscansf; - - foreach my $file (sort keys %filestoscan) - { - $found=0; - my $filesize = -s $file; - if (! $filesize) { next; } + $ret=`mkdir -p "/tmp/emptydir/"`; + + %filestoscan=%filestoscansf; + + foreach my $file (sort keys %filestoscan) + { + $found=0; + my $filesize = -s $file; + if (! $filesize) { next; } print "\n"; - print "Publish file ".$file." to ".$filestoscan{$file}."\n"; - - $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; + print "Publish file ".$file." to ".$filestoscan{$file}."\n"; + + $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; # mkdir #my $ssh = Net::SSH::Perl->new("frs.sourceforge.net"); #$ssh->login("$user","$pass"); - #use String::ShellQuote qw( shell_quote ); + #use String::ShellQuote qw( shell_quote ); #$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit'); #use Net::SFTP::Foreign; @@ -1045,23 +1045,23 @@ if ($nboftargetok) { print "$command\n"; my $ret=`$command 2>&1`; print "$ret\n"; - } - } - } + } + } + } } print "\n----- Summary -----\n"; foreach my $target (keys %CHOOSEDTARGET) { - if ($CHOOSEDTARGET{$target} < 0) { - print "Package $target not built (bad requirement).\n"; - } else { - print "Package $target built successfully in $DESTI\n"; - } + if ($CHOOSEDTARGET{$target} < 0) { + print "Package $target not built (bad requirement).\n"; + } else { + print "Package $target built successfully in $DESTI\n"; + } } if (! $batch) { - print "\nPress key to finish..."; - my $WAITKEY=; + print "\nPress key to finish..."; + my $WAITKEY=; } 0; From 4ff570571e46012f29c4bae291fdb2f985782b0b Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Wed, 29 Oct 2014 05:13:15 +0100 Subject: [PATCH 057/171] Added SOAP client for creating a client order in remote webservice that thirdparty might have. --- htdocs/fourn/commande/card.php | 507 ++++++++++++++++++++++++++------- 1 file changed, 400 insertions(+), 107 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index da4f13e6d53..72c091ff156 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -43,7 +43,9 @@ if (!empty($conf->produit->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (!empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP +$langs->load('admin'); $langs->load('orders'); $langs->load('sendings'); $langs->load('companies'); @@ -1044,6 +1046,91 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } } +if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel')) +{ + $ws_host = GETPOST('ws_host','alpha'); + $ws_key = GETPOST('ws_key','alpha'); + $ws_user = GETPOST('ws_user','alpha'); + $ws_password = GETPOST('ws_password','alpha'); + $ws_entity = GETPOST('ws_entity','int'); + $ws_thirdparty = GETPOST('ws_thirdparty','int'); + + // NS and Authentication parameters + $ws_ns='http://www.dolibarr.org/ns/'; + $ws_authentication=array( + 'dolibarrkey'=>$ws_key, + 'sourceapplication'=>'DolibarrWebServiceClient', + 'login'=>$ws_user, + 'password'=>$ws_password, + 'entity'=>$ws_entity + ); + + //Is everything filled? + if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); + } + else + { + //Create SOAP client and connect it to order + $soapclient_order = new nusoap_client($ws_host."/webservices/server_order.php"); + $soapclient_order->soap_defencoding='UTF-8'; + $soapclient_order->decodeUTF8(false); + + //Create SOAP client and connect it to product/service + $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product->soap_defencoding='UTF-8'; + $soapclient_product->decodeUTF8(false); + + //Prepare the order lines from order + $order_lines = array(); + foreach ($object->lines as $line) + { + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $line->ref_supplier); + $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); + + if ($result_product["result"]["result_code"] == "OK") + { + $order_lines[] = array( + 'desc' => $line->product_desc, + 'type' => $line->product_type, + 'product_id' => $result_product["product"]["id"], + 'vat_rate' => $line->tva_tx, + 'qty' => $line->qty, + 'price' => $line->price, + 'unitprice' => $line->subprice, + 'total_net' => $line->total_ht, + 'total_vat' => $line->total_tva, + 'total' => $line->total_ttc, + 'date_start' => $line->date_start, + 'date_end' => $line->date_end, + ); + } + } + + //Prepare the order header + $order = array( + 'thirdparty_id' => $ws_thirdparty, + 'date' => dol_print_date(dol_now(),'dayrfc'), + 'total_net' => $object->total_ht, + 'total_var' => $object->total_tva, + 'total' => $object->total_ttc, + 'lines' => $order_lines + ); + + $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); + $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); + + if ($result_order["result"]["result_code"] != "OK") + { + setEventMessage($langs->trans("SOAPError").$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); + } + else + { + setEventMessage($langs->trans("RemoteOrderRef").$result_order["ref"], 'mesgs'); + } + } +} + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->commande->creer) { if ($action == 'addcontact') @@ -1769,7 +1856,313 @@ elseif (! empty($object->id)) dol_fiche_end(); - if ($action != 'presend') + /* + * Action presend + */ + if ($action == 'presend') + { + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + + // 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)) + $newlang = $object->client->default_lang; + + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + $result= $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); + $file=$fileparams['fullname']; + } + + print '
    '; + + print_titre($langs->trans('SendOrderByMail')); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; + $liste=array(); + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; + $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); + $formmail->withtopic=$outputlangs->trans('SendOrderRef','__ORDERREF__'); + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + // Tableau des substitutions + $formmail->substit['__ORDERREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_order_supplier_external_BILLING')) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + + // Tableau des parametres complementaires + $formmail->param['action']='send'; + $formmail->param['models']='order_supplier_send'; + $formmail->param['orderid']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + // Show form + print $formmail->get_form(); + + print '
    '; + } + /* + * Action webservice + */ + elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel')) + { + $mode = GETPOST('mode', 'alpha'); + $ws_host = GETPOST('ws_host','alpha'); + $ws_key = GETPOST('ws_key','alpha'); + $ws_user = GETPOST('ws_user','alpha'); + $ws_password = GETPOST('ws_password','alpha'); + + // NS and Authentication parameters + $ws_ns = 'http://www.dolibarr.org/ns/'; + $ws_authentication = array( + 'dolibarrkey'=>$ws_key, + 'sourceapplication'=>'DolibarrWebServiceClient', + 'login'=>$ws_user, + 'password'=>$ws_password, + 'entity'=>'' + ); + + print_titre($langs->trans('CreateRemoteOrder')); + + //Is everything filled? + if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password))) { + setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); + $mode = "init"; + } + + if ($mode == "init") + { + //Table/form header + print ''; + print ''; + print ''; + print ''; + print ''; + $textinput_size = "50"; + + //Remote Host URL + print ''; + + //Remote Webservices key + print ''; + + //Remote User + print ''; + + //Remote Password + print ''; + + //Submit and cancel buttons + print ''; + + //End table/form + print ''; + print '
    '.$langs->trans("Host").'
    '.$langs->trans("KeyForWebServicesAccess").'
    '.$langs->trans("User").'
    '.$langs->trans("Password").'
    '; + print ''; + print '     '; + print ''; + print '
    '; + } + elseif ($mode == "check") + { + $ws_entity = ''; + $ws_thirdparty = ''; + $error_occurred = false; + + //Check if has transport, without any the soap client will give error + if (strpos($ws_host, "http") === false) + { + $ws_host = "http://".$ws_host; + } + + //Create SOAP client and connect it to user + $soapclient_user = new nusoap_client($ws_host."/webservices/server_user.php"); + $soapclient_user->soap_defencoding='UTF-8'; + $soapclient_user->decodeUTF8(false); + + //Get the thirdparty associated to user + $ws_parameters = array('authentication'=>$ws_authentication, 'id' => '', 'ref'=>$ws_user); + $result_user = $soapclient_user->call("getUser", $ws_parameters, $ws_ns, ''); + $user_status_code = $result_user["result"]["result_code"]; + + if ($user_status_code == "OK") + { + //Fill the variables + $ws_entity = $result_user["user"]["entity"]; + $ws_authentication['entity'] = $ws_entity; + $ws_thirdparty = $result_user["user"]["fk_thirdparty"]; + if (empty($ws_thirdparty)) + { + setEventMessage($langs->trans("RemoteUserMissingAssociatedSoc"), 'errors'); + } + else + { + //Create SOAP client and connect it to product/service + $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product->soap_defencoding='UTF-8'; + $soapclient_product->decodeUTF8(false); + + // Iterate each line and get the reference that uses the supplier of that product/service + $i = 0; + foreach ($object->lines as $line) { + $i = $i + 1; + $ref_supplier = $line->ref_supplier; + $line_id = $i."º) ".$line->product_ref.": "; + if (empty($ref_supplier)) { + continue; + } + $ws_parameters = array('authentication' => $ws_authentication, 'id' => '', 'ref' => $ref_supplier); + $result_product = $soapclient_product->call("getProductOrService", $ws_parameters, $ws_ns, ''); + if (!$result_product) + { + setEventMessage($line_id.$langs->trans("SOAPError")." ".$soapclient_product->error_str." - ".$soapclient_product->response, 'errors'); + $error_occurred = true; + break; + } + + // Check the result code + $status_code = $result_product["result"]["result_code"]; + if ($status_code != "OK") + { + if ($status_code == "NOT_FOUND") + { + setEventMessage($line_id.$langs->trans("SupplierMissingRef")." '".$ref_supplier."'", 'warnings'); + } + else + { + setEventMessage($line_id.$langs->trans("ResponseNonOK")." '".$status_code."' - '".$result_product["result"]["result_label"]."'", 'errors'); + $error_occurred = true; + break; + } + } + + + // Ensure that price is equal and warn user if it's not + $supplier_price = price($result_product["product"]["price_net"]); //Price of client tab in supplier dolibarr + $local_price = NULL; //Price of supplier as stated in product suppliers tab on this dolibarr, NULL if not found + + $product_fourn = new ProductFournisseur($db); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($line->fk_product); + if (count($product_fourn_list)>0) + { + foreach($product_fourn_list as $product_fourn_line) + { + //Only accept the line where the supplier is the same at this order and has the same ref + if ($product_fourn_line->fourn_id == $object->socid && $product_fourn_line->fourn_ref == $ref_supplier) { + $local_price = price($product_fourn_line->fourn_price); + } + } + } + + if ($local_price != NULL && $local_price != $supplier_price) { + setEventMessage($line_id.$langs->trans("RemotePriceMismatch")." ".$supplier_price." - ".$local_price, 'warnings'); + } + + // Check if is in sale + if (empty($result_product["product"]["status_tosell"])) { + setEventMessage($line_id.$langs->trans("ProductStatusNotOnSellShort")." '".$ref_supplier."'", 'warnings'); + } + } + } + + } + elseif ($user_status_code == "PERMISSION_DENIED") + { + setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); + } + else + { + setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); + } + + //Form + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($error_occurred) + { + print "
    ".$langs->trans("ErrorOccurredReviseAndRetry")."
    "; //TODO: Translate + } + else + { + print ''; + print '     '; + } + print ''; + print '
    '; + } + } + /* + * Show buttons + */ + else { /** * Boutons actions @@ -1849,6 +2242,12 @@ elseif (! empty($object->id)) //} } + // Create a remote order using WebService + if ($object->statut >= 2) // 2 means accepted + { + print ''.$langs->trans('CreateRemoteOrder').''; + } + // Cancel if ($object->statut == 2) { @@ -1975,112 +2374,6 @@ elseif (! empty($object->id)) print ''; } - /* - * Action presend - */ - if ($action == 'presend') - { - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - - // 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)) - $newlang = $object->client->default_lang; - - if (!empty($newlang)) - { - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang($newlang); - $outputlangs->load('commercial'); - } - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - $result= $object->generateDocument(GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); - $file=$fileparams['fullname']; - } - - print '
    '; - - print_titre($langs->trans('SendOrderByMail')); - - // Cree l'objet formulaire mail - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; - $liste=array(); - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$outputlangs->trans('SendOrderRef','__ORDERREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - // Tableau des substitutions - $formmail->substit['__ORDERREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - $formmail->substit['__CONTACTCIVNAME__']=''; - - //Find the good contact adress - $custcontact=''; - $contactarr=array(); - $contactarr=$object->liste_contact(-1,'external'); - - if (is_array($contactarr) && count($contactarr)>0) { - foreach($contactarr as $contact) { - if ($contact['libelle']==$langs->trans('TypeContact_order_supplier_external_BILLING')) { - require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - $contactstatic=new Contact($db); - $contactstatic->fetch($contact['id']); - $custcontact=$contactstatic->getFullName($langs,1); - } - } - - if (!empty($custcontact)) { - $formmail->substit['__CONTACTCIVNAME__']=$custcontact; - } - } - - // Tableau des parametres complementaires - $formmail->param['action']='send'; - $formmail->param['models']='order_supplier_send'; - $formmail->param['orderid']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - // Show form - print $formmail->get_form(); - - print '
    '; - } - print ''; } From e875f0c2b8c402fd7f10a11f8b8e903f7380d6fb Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Wed, 29 Oct 2014 05:33:59 +0100 Subject: [PATCH 058/171] Fixed missing separator --- htdocs/fourn/commande/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 72c091ff156..b8d9d74e147 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1122,11 +1122,11 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' if ($result_order["result"]["result_code"] != "OK") { - setEventMessage($langs->trans("SOAPError").$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); + setEventMessage($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); } else { - setEventMessage($langs->trans("RemoteOrderRef").$result_order["ref"], 'mesgs'); + setEventMessage($langs->trans("RemoteOrderRef")." ".$result_order["ref"], 'mesgs'); } } } From fa61faec589d4c7b2033e240451461a67b92e304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Jos=C3=A9=20Lizar=C3=A1n=20Rus?= Date: Wed, 29 Oct 2014 17:43:01 +0100 Subject: [PATCH 059/171] Update server_invoice.php Create Facture with mode_reglement and cond_reglement using thirdparty information. --- htdocs/webservices/server_invoice.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index ef87beace53..9c5bd24b463 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -525,7 +525,15 @@ function createInvoice($authentication,$invoice) $newobject->statut=0; // We start with status draft $newobject->fk_project=$invoice['project_id']; $newobject->date_creation=$now; - $newobject->mode_reglement_id = $invoice['payment_mode_id']; + + //take mode_reglement and cond_reglement from thirdparty + $soc = new Societe($db); + $res=$soc->fetch($newobject->socid); + if ($res > 0) { + $newobject->mode_reglement_id = ! empty($invoice['payment_mode_id'])?$invoice['payment_mode_id']:$soc->mode_reglement_id; + $newobject->cond_reglement_id = $soc->cond_reglement_id; + } + else $newobject->mode_reglement_id = $invoice['payment_mode_id']; // Trick because nusoap does not store data with same structure if there is one or several lines $arrayoflines=array(); From c5045a75d8884fe8ce871c3836137b57793be8d5 Mon Sep 17 00:00:00 2001 From: jfefe Date: Thu, 30 Oct 2014 01:16:37 +0100 Subject: [PATCH 060/171] Missing trans key into resource module --- htdocs/langs/en_US/resource.lang | 4 +++- htdocs/langs/fr_FR/resource.lang | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 502d328d7c3..b17cae82f29 100755 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Resource linked with success TitleResourceCard=Resource card ConfirmDeleteResource=Confirm to delete this resource RessourceSuccessfullyDeleted=Resource successfully deleted -DictionaryResourceType=Type of resources \ No newline at end of file +DictionaryResourceType=Type of resources + +SelectResource=Select resource diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang index e4c8a6ade87..5059d628092 100755 --- a/htdocs/langs/fr_FR/resource.lang +++ b/htdocs/langs/fr_FR/resource.lang @@ -32,4 +32,6 @@ ResourceLinkedWithSuccess=Ressource liée avec succès TitleResourceCard=Fiche ressource ConfirmDeleteResource=Confirmer la suppression de cette ressource? RessourceSuccessfullyDeleted=Ressource effacée avec succès -DictionaryResourceType=Type de ressources \ No newline at end of file +DictionaryResourceType=Type de ressources + +SelectResource=Sélectionner la ressource From e370ffb2d44cdd453fde42e48e9955908f073330 Mon Sep 17 00:00:00 2001 From: jfefe Date: Thu, 30 Oct 2014 01:33:39 +0100 Subject: [PATCH 061/171] Bad function call --- htdocs/resource/class/resource.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 9cf6a83ef1d..d9ad13f83b1 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -23,8 +23,8 @@ */ // Put here all includes required by your class file -require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); - +require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; /** * DAO Resource object @@ -330,12 +330,12 @@ class Resource extends CommonObject function delete($rowid, $notrigger=0) { global $user,$langs,$conf; - + $error=0; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource"; $sql.= " WHERE rowid =".$rowid; - + dol_syslog(get_class($this)."::delete sql=".$sql); if ($this->db->query($sql)) { @@ -355,7 +355,7 @@ class Resource extends CommonObject } // End call triggers } - + return 1; } else { @@ -371,7 +371,7 @@ class Resource extends CommonObject return -1; } } - + /** * Load resource objects into $this->lines * @@ -507,9 +507,9 @@ class Resource extends CommonObject $line->fk_user_create = $obj->fk_user_create; if($obj->resource_id && $obj->resource_type) - $line->objresource = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type); if($obj->element_id && $obj->element_type) - $line->objelement = $this->fetchObjectByElement($obj->element_id,$obj->element_type); + $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); $this->lines[$i] = $line; $i++; @@ -591,7 +591,7 @@ class Resource extends CommonObject $line->mandatory = $obj->mandatory; $line->fk_user_create = $obj->fk_user_create; - $this->lines[$i] = $this->fetchObjectByElement($obj->resource_id,$obj->resource_type); + $this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type); $i++; } @@ -814,7 +814,7 @@ class Resource extends CommonObject $i=0; foreach($resources as $nb => $resource) { - $this->lines[$i] = $this->fetchObjectByElement($resource['resource_id'],$resource['resource_type']); + $this->lines[$i] = fetchObjectByElement($resource['resource_id'],$resource['resource_type']); $i++; } return $i; From 38a939771c1dd1a403df94b6b7dad77472ec41f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 17:16:51 +0100 Subject: [PATCH 062/171] New: Add template of emails into dictionnary. --- htdocs/admin/dict.php | 61 ++++++++++++++++--- .../install/mysql/migration/3.6.0-3.7.0.sql | 1 + .../mysql/tables/llx_c_email_templates.sql | 1 + 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d81f306be9e..4d33723a947 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -70,7 +70,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,23,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24); +$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,23,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,0,25); // Name of SQL tables of dictionaries $tabname=array(); @@ -98,6 +98,7 @@ $tabname[21]= MAIN_DB_PREFIX."c_availability"; $tabname[22]= MAIN_DB_PREFIX."c_input_reason"; $tabname[23]= MAIN_DB_PREFIX."c_revenuestamp"; $tabname[24]= MAIN_DB_PREFIX."c_type_resource"; +$tabname[25]= MAIN_DB_PREFIX."c_email_templates"; // Dictionary labels $tablib=array(); @@ -125,6 +126,7 @@ $tablib[21]= "DictionaryAvailability"; $tablib[22]= "DictionarySource"; $tablib[23]= "DictionaryRevenueStamp"; $tablib[24]= "DictionaryResourceType"; +$tablib[25]= "DictionaryEMailTemplates"; // Requests to extract data $tabsql=array(); @@ -152,6 +154,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; +$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -179,6 +182,7 @@ $tabsqlsort[21]="code ASC, label ASC"; $tabsqlsort[22]="code ASC, label ASC"; $tabsqlsort[23]="country ASC, taux ASC"; $tabsqlsort[24]="code ASC,label ASC"; +$tabsqlsort[25]="label ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); @@ -206,6 +210,7 @@ $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[24]= "code,label"; +$tabfield[25]= "label,type_template,private,position,topic,content"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); @@ -233,6 +238,7 @@ $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[24]= "code,label"; +$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); @@ -260,6 +266,7 @@ $tabfieldinsert[21]= "code,label"; $tabfieldinsert[22]= "code,label"; $tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[24]= "code,label"; +$tabfieldinsert[25]= "label,type_template,private,position,topic,content"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -288,7 +295,8 @@ $tabrowid[20]= ""; $tabrowid[21]= "rowid"; $tabrowid[22]= "rowid"; $tabrowid[23]= ""; -$tabrowid[23]= ""; +$tabrowid[24]= ""; +$tabrowid[25]= ""; // Condition to show dictionary in setup page $tabcond=array(); @@ -316,6 +324,7 @@ $tabcond[21]= ! empty($conf->propal->enabled); $tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled)); $tabcond[23]= true; $tabcond[24]= ! empty($conf->resource->enabled); +$tabcond[25]= true; // && ! empty($conf->global->MAIN_EMAIL_EDIT_TEMPLATE_FROM_DIC); // List of help for fields $tabhelp=array(); @@ -343,6 +352,7 @@ $tabhelp[21] = array(); $tabhelp[22] = array(); $tabhelp[23] = array(); $tabhelp[24] = array(); +$tabhelp[25] = array(); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -370,6 +380,7 @@ $tabfieldcheck[21] = array(); $tabfieldcheck[22] = array(); $tabfieldcheck[23] = array(); $tabfieldcheck[24] = array(); +$tabfieldcheck[25] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); @@ -442,7 +453,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; @@ -489,7 +500,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
    '; }*/ } - if (isset($_POST["country"]) && $_POST["country"]=='0') + if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) { if (in_array($tablib[$id],array('DictionaryCompanyType'))) { @@ -533,6 +544,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; + // List of values if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $newid.","; @@ -846,6 +858,13 @@ if ($id) if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); } if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } + + if ($id == 2) // Special cas for state page + { + if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; } + if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; } + } + if ($valuetoshow != '') { print ''; @@ -856,12 +875,14 @@ if ($id) } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; } + + if ($id == 4) print ''; print ''; print ''; print ' '; print ''; - // Line to type new values + // Line to enter new values print ""; $obj = new stdClass(); @@ -880,16 +901,25 @@ if ($id) $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; + if ($id == 3) + { + unset($fieldlist[2]); + } + if (empty($reshook)) fieldList($fieldlist,$obj); + if ($id == 4) print ''; print ''; print ""; + $colspan=count($fieldlist)+2; + if ($id == 4) $colspan++;; + if (! empty($alabelisused)) // Si un des champs est un libelle { - print '* '.$langs->trans("LabelUsedByDefault").'.'; + print '* '.$langs->trans("LabelUsedByDefault").'.'; } - print ' '; + print ' '; } print ''; @@ -965,6 +995,7 @@ if ($id) if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); } if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } + // Affiche nom du champ if ($showfield) { @@ -1302,7 +1333,7 @@ $db->close(); /** - * Show field + * Show fields in insert/edit mode * * @param array $fieldlist Array of fields * @param Object $obj If we show a particular record, obj is filled with record fields @@ -1322,14 +1353,22 @@ function fieldList($fieldlist,$obj='',$tabname='') foreach ($fieldlist as $field => $value) { if ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) { print ''.join(',',$fieldlist).' '; continue; } // For state page, we do not show the country input (we link to region, not country) + if (in_array('region_id',$fieldlist)) + { + print ''; + //print join(',',$fieldlist); + print ''; + continue; + } // For state page, we do not show the country input (we link to region, not country) print ''; print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28); print ''; } elseif ($fieldlist[$field] == 'country_id') { $country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); + print ''; print ''; + print ''; } elseif ($fieldlist[$field] == 'region') { print ''; @@ -1338,7 +1377,9 @@ function fieldList($fieldlist,$obj='',$tabname='') } elseif ($fieldlist[$field] == 'region_id') { $region_id = (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:0); + print ''; print ''; + print ''; } elseif ($fieldlist[$field] == 'lang') { print ''; @@ -1377,7 +1418,7 @@ function fieldList($fieldlist,$obj='',$tabname='') print ''; print ''; } - elseif ($fieldlist[$field] == 'libelle_facture') { + elseif (in_array($fieldlist[$field], array('libelle_facture','content'))) { print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { 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 c2e10543b7a..7156acc2ff2 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 @@ -1026,6 +1026,7 @@ create table llx_c_email_templates tms timestamp, label varchar(255), -- Label of predefined email position smallint, -- Position + active tinyint DEFAULT 1 NOT NULL, topic text, -- Predefined topic content text -- Predefined text ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.sql b/htdocs/install/mysql/tables/llx_c_email_templates.sql index 3a72690fb11..b4d2f9a96cb 100644 --- a/htdocs/install/mysql/tables/llx_c_email_templates.sql +++ b/htdocs/install/mysql/tables/llx_c_email_templates.sql @@ -30,6 +30,7 @@ create table llx_c_email_templates tms timestamp, label varchar(255), -- Label of predefined email position smallint, -- Position + active tinyint DEFAULT 1 NOT NULL, topic text, -- Predefined topic content text -- Predefined text )ENGINE=innodb; From f7552c83d2f3391a78e1a72d7ae5a49be6f0a74f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 17:50:34 +0100 Subject: [PATCH 063/171] Fix: Must ignore such fields --- test/phpunit/FactureTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 11795c08fe2..cce025a77eb 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -215,7 +215,7 @@ class FactureTest extends PHPUnit_Framework_TestCase $newlocalobject=new Facture($this->savdb); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); - $this->assertEquals($this->objCompare($localobject,$newlocalobject,true,array('id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem','ref','statut','paye','specimen','facnumber','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement','cond_reglement_doc')), array()); // Actual, Expected + $this->assertEquals($this->objCompare($localobject,$newlocalobject,true,array('newref','oldref','id','lines','client','thirdparty','brouillon','user_author','date_creation','date_validation','datem','ref','statut','paye','specimen','facnumber','actiontypecode','actionmsg2','actionmsg','mode_reglement','cond_reglement','cond_reglement_doc')), array()); // Actual, Expected return $localobject; } From fb4858a5d32c850629f24fde1ac9f49077cb7365 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 18:07:09 +0100 Subject: [PATCH 064/171] Update changelog --- ChangeLog | 3 +++ htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index d6e412ec06e..6b3616e0d46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Increase length of thirdparty to 128 chars. +- New: "Is Order shippable" icon #1975. +- New: statistics on supplier orders and invoices on home page. - New: Add permissions to read all trips and expenses. - New: Can filter on date into tab "Referring object" of a project. - New: Module notification has been enhanced: 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 7156acc2ff2..aa940e4ff20 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 @@ -1064,6 +1064,9 @@ ALTER TABLE llx_adherent CHANGE COLUMN civilite civility VARCHAR(6); ALTER TABLE llx_socpeople CHANGE COLUMN civilite civility VARCHAR(6); ALTER TABLE llx_user CHANGE COLUMN civilite civility VARCHAR(6); +ALTER TABLE llx_societe CHANGE COLUMN nom varchar(128); +ALTER TABLE llx_adherent CHANGE COLUMN societe varchar(128); + ALTER TABLE llx_c_type_fees CHANGE COLUMN libelle label VARCHAR(30); ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label; From e3041f45ee9f61dccfdfed370acbd97ce9364656 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 18:08:42 +0100 Subject: [PATCH 065/171] Update changelog --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index cc36bf92412..bab2b804a5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 3.5.6 compared to 3.5.5 ***** +Fix: Avoid missing class error for fetch_thirdparty method #1973 + ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** Fix: Holiday module was broken. Initializaion of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. From d5f21caca607b5e652981a4bf19bc40fa35e4309 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 18:19:41 +0100 Subject: [PATCH 066/171] Update doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 6b3616e0d46..c5aeb5874b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Agenda export by project #1967. - New: Increase length of thirdparty to 128 chars. - New: "Is Order shippable" icon #1975. - New: statistics on supplier orders and invoices on home page. From f18e513046cb3c6b00829d8318921cdbd7e0dc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Oct 2014 18:44:56 +0100 Subject: [PATCH 067/171] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8848adea948..7c7c280bef3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1832,11 +1832,12 @@ class Form * @param string $filterkey Filtre des produits * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell * @param int $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit of line number * @return array Array of keys for json */ - function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0) + function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100) { - global $langs,$conf; + global $langs,$conf,$db; $out=''; $outarray=array(); @@ -1874,6 +1875,7 @@ class Form $sql.=')'; } $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; + $sql.= $db->plimit($limit); // Build output string From 08e958152cbdbd66dc0805c55e179098aae7dc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Oct 2014 18:45:47 +0100 Subject: [PATCH 068/171] Update ajax.lib.php --- htdocs/core/lib/ajax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index d6cc1a287d7..93f23557c24 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -173,7 +173,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt } $("#search_'.$htmlname.'").trigger("change"); // To tell that input text field was modified } - ,delay: 1000 + ,delay: 500 }).data( "autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) .data( "item.autocomplete", item ) From 2f5c7e5f9d9c29e51e9c915c7bc05ae09150ce98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 19:28:22 +0100 Subject: [PATCH 069/171] Prepare version 3.7 beta --- build/debian/changelog | 29 ++++++++++++++++++----------- build/exe/doliwamp/doliwamp.iss | 4 ++-- build/makepack-dolibarr.pl | 5 ++++- build/rpm/dolibarr_fedora.spec | 3 +++ build/rpm/dolibarr_generic.spec | 3 +++ build/rpm/dolibarr_mandriva.spec | 3 +++ build/rpm/dolibarr_opensuse.spec | 3 +++ htdocs/filefunc.inc.php | 2 +- 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 76e8ae3a2fc..d3772a76785 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,74 +1,81 @@ -dolibarr (3.6.1-3) unstable; urgency=low +dolibarr (3.7.0-3) UNRELEASED; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) Tue, 21 Oct 2014 12:00:00 +0100 + +dolibarr (3.6.1-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Tue, 23 Sep 2014 12:00:00 +0100 -dolibarr (3.6.0-3) unstable; urgency=low +dolibarr (3.6.0-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Tue, 15 July 2014 12:00:00 +0100 -dolibarr (3.5.5-3) unstable; urgency=low +dolibarr (3.5.5-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Tue, 8 July 2014 12:00:00 +0100 -dolibarr (3.5.4-3) unstable; urgency=low +dolibarr (3.5.4-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Tue, 1 July 2014 12:00:00 +0100 -dolibarr (3.5.3-3) unstable; urgency=low +dolibarr (3.5.3-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Fri, 2 May 2014 12:00:00 +0100 -dolibarr (3.5.2-3) unstable; urgency=low +dolibarr (3.5.2-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Fri, 14 March 2014 12:00:00 +0100 -dolibarr (3.5.1-3) unstable; urgency=low +dolibarr (3.5.1-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Fri, 7 Feb 2014 12:00:00 +0100 -dolibarr (3.5.0-3) unstable; urgency=low +dolibarr (3.5.0-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. -- Laurent Destailleur (eldy) Fri, 31 Jan 2014 12:00:00 +0100 -dolibarr (3.4.2-3) unstable; urgency=low +dolibarr (3.4.2-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. -- Laurent Destailleur (eldy) Mon, 30 Dec 2013 12:00:00 +0100 -dolibarr (3.4.1-3) unstable; urgency=low +dolibarr (3.4.1-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. -- Laurent Destailleur (eldy) Mon, 27 Apr 2013 12:00:00 +0100 -dolibarr (3.4.0-3) unstable; urgency=low +dolibarr (3.4.0-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * Maintenance release. diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 1657ff1c7e7..3a43f7fe656 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.6.1 +AppVerName=DoliWamp-3.7.0-beta ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.6.1 +OutputBaseFilename=DoliWamp-3.7.0-beta ; ----- End of change ;OutputManifestFile=build\doliwampbuild.log ; Define full path from which all relative path are defined diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 3f637ef856e..2a4af64f5fe 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -436,13 +436,16 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; @@ -452,7 +455,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/adapters`; # Keep this removal in case we embed libraries - #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball + #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball due to debian policies $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 156f34bc066..1007c84eb96 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -332,6 +332,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3 +- Upstream release + * Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 176cb07975d..5fd9a74f1a6 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -568,6 +568,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3 +- Upstream release + * Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index d75c9a84dca..c6fda416db0 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -337,6 +337,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3 +- Upstream release + * Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 - Upstream release diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 41ea838f3fb..935ebf2e6df 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -348,6 +348,9 @@ fi # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release %changelog +* Wed Oct 29 2014 Laurent Destailleur 3.7.0-0.3 +- Upstream release + * Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3 - Upstream release diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 6f8a2bb9b2c..d69de2f1fae 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.0-alpha'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.0-beta'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 57f49ec5d4ddcd4b30c24255eb8ac822aa110aad Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 30 Oct 2014 20:41:08 +0100 Subject: [PATCH 070/171] GPLv3 --- .../admin/adherent_type_extrafields.php | 3 +- htdocs/core/class/html.formcron.class.php | 3 +- htdocs/core/lib/invoice2.lib.php | 27 ++++++++-------- htdocs/install/mssql/functions/functions.sql | Bin 5088 -> 5010 bytes .../class/html.formresource.class.php | 29 +++++++++--------- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index dca8796b681..aa5e8cfa8d9 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -7,7 +7,7 @@ * * 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 2 of the License, or + * 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, @@ -17,6 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * or see http://www.gnu.org/ */ /** diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index bce8d9f041e..4de88a7bfc9 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -4,7 +4,7 @@ * * 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 2 of the License, or + * 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, @@ -14,6 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * or see http://www.gnu.org/ */ /** diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 9309d083187..fb9d8f90f70 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -2,19 +2,20 @@ /* * Copyright (C) 2009-2013 Laurent Destailleur * -* 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 2 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 . -*/ + * 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 . + * or see http://www.gnu.org/ + */ /** * \file htdocs/core/lib/invoice2.lib.php diff --git a/htdocs/install/mssql/functions/functions.sql b/htdocs/install/mssql/functions/functions.sql index 93766a224064a3dc68cab3dc0878f1477af69f1d..1c2c76996dc312cc2440a2329d46530adb815d7c 100644 GIT binary patch delta 170 zcmaE$K1qE87c-;rW^QI(=6XE_1qM%sG$5JBkk3%UpaWzTGo%8c0)q`h22iAgp@6}P zK_3Xq!BCGO9jLaHK@X_D2*}oF$YIE2NCxW21M4gXir4{VxfpbTPywt8VJ4c1V%Uw` JEX{tD2LNb29=HGi delta 197 zcmbQF{y=>L7c-;LW^QI(W@T#z1%^z9G$5JBkk3%UpaW!;GZX>EN*Gds>=K6j$!nQZ zS-BW=8FVLKWD>6jsqh4H -* -* 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 2 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 . -*/ + * + * 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 . + * or see http://www.gnu.org/ + */ /** * \file place/class/html.place.class.php From 24862d6314c66cffd6fa21d8a7a7984c8846e07b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 22:51:06 +0100 Subject: [PATCH 071/171] Corrections launchpad --- build/launchpad/README | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index 973509aa6d1..03ddc7fd4e6 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -61,13 +61,17 @@ If you want to build/test package locally: - List of series are visible here: https://launchpad.net/dolibarr/+series -# To update Dolibarr into launchpad (when repository for sources already exists) +# To update Dolibarr into launchpad (when remote repository for sources already exists) #---------------------------------- + # create local repository cd bzr - bzr branch lp:~yourlogin/dolibarr/[dev|beta|stable] + bzr branch lp:~yourlogin/dolibarr/[develop|beta|stable] dolibarr-[dev|beta|stable] cd dolibarr-[dev|beta|stable] + # Update + bzr update + -- Update files here. Remove all and overwrite -- bzr status - -- Update files here -- + bzr add * bzr commit -m "Description of change" bzr push From 557cbaf3d7942e68b46e21dd24f18f8e4c78bcde Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Fri, 31 Oct 2014 04:59:57 +0100 Subject: [PATCH 072/171] Added module descriptor and activation checks Corrected 3 missing $error_occurred flags --- .../modSyncSupplierWebServices.class.php | 121 ++++++++++++++++++ htdocs/fourn/commande/card.php | 15 ++- 2 files changed, 132 insertions(+), 4 deletions(-) create mode 100755 htdocs/core/modules/modSyncSupplierWebServices.class.php diff --git a/htdocs/core/modules/modSyncSupplierWebServices.class.php b/htdocs/core/modules/modSyncSupplierWebServices.class.php new file mode 100755 index 00000000000..088989f9de4 --- /dev/null +++ b/htdocs/core/modules/modSyncSupplierWebServices.class.php @@ -0,0 +1,121 @@ + + * + * 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 . + */ + +/** + * \defgroup webservices Module webservices + * \brief Module to enable client for supplier WebServices + * \file htdocs/core/modules/modSyncSupplierWebServices.class.php + * \ingroup webservices + * \brief File to describe client for supplier webservices module + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + +/** + * Class to describe a WebServices module + */ +class modSyncSupplierWebServices extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + $this->numero = 2650; + + $this->family = "technic"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "Enable the client for external supplier web services"; + $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 1; + // Name of image file used for this module. + $this->picto='technic'; + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Config pages + //------------- + //$this->config_page_url = array("webservices.php@webservices"); + + // Dependancies + //------------- + $this->depends = array(); + $this->requiredby = array(); + $this->langfiles = array("other"); + + // Constantes + //----------- + $this->const = array(); + + // New pages on tabs + // ----------------- + $this->tabs = array(); + + // Boxes + //------ + $this->boxes = array(); + + // Permissions + //------------ + $this->rights = array(); + $this->rights_class = 'syncsupplierwebservices'; + $r=0; + } + + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function init($options='') + { + // Prevent pb of modules not correctly disabled + //$this->remove($options); + + $sql = array(); + + return $this->_init($sql,$options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function remove($options='') + { + $sql = array(); + + return $this->_remove($sql,$options); + } + +} diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b8d9d74e147..263a96bdca4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Ion Agorria * * 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 @@ -1065,8 +1066,10 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' 'entity'=>$ws_entity ); - //Is everything filled? - if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + //Is sync supplier web services module activated? and everything filled? + if (empty($conf->syncsupplierwebservices->enabled)) { + setEventMessage($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name"))); + } else if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); } else @@ -2054,6 +2057,7 @@ elseif (! empty($object->id)) if (empty($ws_thirdparty)) { setEventMessage($langs->trans("RemoteUserMissingAssociatedSoc"), 'errors'); + $error_occurred = true; } else { @@ -2129,10 +2133,12 @@ elseif (! empty($object->id)) elseif ($user_status_code == "PERMISSION_DENIED") { setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); + $error_occurred = true; } else { setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); + $error_occurred = true; } //Form @@ -2242,8 +2248,9 @@ elseif (! empty($object->id)) //} } - // Create a remote order using WebService - if ($object->statut >= 2) // 2 means accepted + + // Create a remote order using WebService only if module is activated + if (! empty($conf->syncsupplierwebservices->enabled) && $object->statut >= 2) // 2 means accepted { print ''.$langs->trans('CreateRemoteOrder').''; } From e43de8b815f46a690c62cc0284120cc34623be35 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 31 Oct 2014 07:37:59 +0100 Subject: [PATCH 073/171] Update module accounting --- htdocs/accountancy/admin/account.php | 60 ++++++++++++++------- htdocs/accountancy/admin/card.php | 5 -- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/core/modules/modAccounting.class.php | 8 +++ 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 60ff4b125c3..fbb8cf84baa 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -37,6 +37,12 @@ $mesg = ''; $action = GETPOST('action'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); +$search= GETPOST("search"); +$search_account = GETPOST("search_account"); +$search_label = GETPOST("search_label"); +$search_accountparent = GETPOST("search_accountparent"); +$search_pcgtype = GETPOST("search_pcgtype"); +$search_pcgsubtype = GETPOST("search_pcgsubtype"); // Security check if (!$user->admin) @@ -83,6 +89,16 @@ if ($action == 'disable') { } } +if (GETPOST("button_removefilter")) +{ + $search=""; + $search_account=""; + $search_label=""; + $search_accountparent=""; + $search_pcgtype=""; + $search_pcgsubtype=""; +} + /* * View * @@ -96,20 +112,20 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX $sql .= " WHERE aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $pcgver; -if (strlen(trim($_GET["search_account"]))) { - $sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'"; +if (strlen(trim($search_account))) { + $sql .= " AND aa.account_number like '%" . $search_account . "%'"; } -if (strlen(trim($_GET["search_label"]))) { - $sql .= " AND aa.label like '%" . $_GET["search_label"] . "%'"; +if (strlen(trim($search_label))) { + $sql .= " AND aa.label like '%" . $search_label . "%'"; } -if (strlen(trim($_GET["search_accountparent"]))) { - $sql .= " AND aa.account_parent like '%" . $_GET["search_accountparent"] . "%'"; +if (strlen(trim($search_accountparent))) { + $sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'"; } -if (strlen(trim($_GET["search_pcgtype"]))) { - $sql .= " AND aa.pcg_type like '%" . $_GET["search_pcgtype"] . "%'"; +if (strlen(trim($search_pcgtype))) { + $sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'"; } -if (strlen(trim($_GET["search_pcgsubtype"]))) { - $sql .= " AND aa.pcg_subtype like '%" . $_GET["search_pcgsubtype"] . "%'"; +if (strlen(trim($search_pcgsubtype))) { + $sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'"; } $sql .= $db->order($sortfield, $sortorder); @@ -141,18 +157,20 @@ if ($result) { print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ' '; - print ''; - print ''; + print ''; + print ''; + print '  '; + print ''; print ''; print ''; @@ -180,11 +198,13 @@ if ($result) { } print ''; - print ''; + // Action + print ''; if ($user->admin) { print ''; print img_edit(); - print ' '; + print ''; + print ' '; print ''; print img_delete(); print ''; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 9ebdea5fefc..ad6ca01b6ca 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -181,11 +181,6 @@ else if ($id) if ($action == 'update') { - // WYSIWYG Editor - $htmlacc = new FormVentilation($db); - - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $soc = new Societe($db); if ($object->socid) { $soc->fetch($object->socid); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1d6e12b1357..71b6d29ea42 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -952,7 +952,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->accounting->enabled)) { $newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); - $newmenu->add("/accountancy/admin/account.php?mainmenu=home", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear'); + $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount'); } } diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 9a544b1ece0..e074bfe82f1 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -229,6 +229,14 @@ class modAccounting extends DolibarrModules $this->rights[$r][4] = 'fiscalyear'; $this->rights[$r][5] = ''; $r++; + + $this->rights[$r][0] = 50440; + $this->rights[$r][1] = 'Manage chart of accounts'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'chartofaccount'; + $this->rights[$r][5] = ''; + $r++; // Main menu entries $this->menus = array(); From 9c51effe5cbddf5a3ec01ca2999d433967d08d0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Oct 2014 15:41:58 +0100 Subject: [PATCH 074/171] Ajout plus d'info dans description audit. --- htdocs/admin/tools/listevents.php | 5 +++-- htdocs/core/class/events.class.php | 4 ++-- htdocs/core/triggers/interface_20_all_Logevents.class.php | 2 ++ htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 4 ++-- htdocs/main.inc.php | 4 +++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index c2671f698a4..fe577419eaf 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -229,10 +229,11 @@ if ($result) // Description print ''; $text=$langs->trans($obj->description); - if (preg_match('/\((.*)\)/i',$obj->description,$reg)) + if (preg_match('/\((.*)\)(.*)/i',$obj->description,$reg)) { $val=explode(',',$reg[1]); $text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:''); + if (! empty($reg[2])) $text.=$reg[2]; } print $text; print ''; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index ba4dcfb94f6..e191773517b 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -111,7 +111,7 @@ class Events // extends CommonObject $this->description=trim($this->description); // Check parameters - if (! $this->description) { $this->error='ErrorBadValueForParameter'; return -1; } + if (empty($this->description)) { $this->error='ErrorBadValueForParameter'; return -1; } // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."events("; @@ -129,7 +129,7 @@ class Events // extends CommonObject $sql.= " ".($_SERVER['HTTP_USER_AGENT']?"'".dol_trunc($_SERVER['HTTP_USER_AGENT'],250)."'":'NULL').","; $sql.= " '".$this->db->idate($this->dateevent)."',"; $sql.= " ".($user->id?"'".$user->id."'":'NULL').","; - $sql.= " '".$this->db->escape($this->description)."'"; + $sql.= " '".$this->db->escape(dol_trunc($this->description,250))."'"; $sql.= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index b73d01ec612..34bd187adbf 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -66,7 +66,9 @@ class InterfaceLogevents extends DolibarrTriggers // Initialisation donnees (date,duree,texte,desc) $text="(UserLogged,".$object->login.")"; + $text.=(empty($object->trigger_mesg)?'':' - '.$object->trigger_mesg); $desc="(UserLogged,".$object->login.")"; + $desc.=(empty($object->trigger_mesg)?'':' - '.$object->trigger_mesg); } if ($action == 'USER_LOGIN_FAILED') { 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 aa940e4ff20..0cacdf1ffae 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 @@ -1064,8 +1064,8 @@ ALTER TABLE llx_adherent CHANGE COLUMN civilite civility VARCHAR(6); ALTER TABLE llx_socpeople CHANGE COLUMN civilite civility VARCHAR(6); ALTER TABLE llx_user CHANGE COLUMN civilite civility VARCHAR(6); -ALTER TABLE llx_societe CHANGE COLUMN nom varchar(128); -ALTER TABLE llx_adherent CHANGE COLUMN societe varchar(128); +ALTER TABLE llx_societe MODIFY COLUMN nom varchar(128); +ALTER TABLE llx_adherent MODIFY COLUMN societe varchar(128); ALTER TABLE llx_c_type_fees CHANGE COLUMN libelle label VARCHAR(30); ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index efca5d4efba..fa6b503caa7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -460,7 +460,7 @@ if (! defined('NOLOGIN')) $datesecond=dol_stringtotime($_POST["dst_second"]); if ($datenow >= $datefirst && $datenow < $datesecond) $dol_dst=1; } - //print $datefirst.'-'.$datesecond.'-'.$datenow; exit; + //print $datefirst.'-'.$datesecond.'-'.$datenow.'-'.$dol_tz.'-'.$dol_tzstring.'-'.$dol_dst; exit; } if (! $login) @@ -621,6 +621,8 @@ if (! defined('NOLOGIN')) $user->update_last_login_date(); + $user->trigger_mesg = 'TZ='.$_SESSION["dol_tz"].';TZString='.$_SESSION["dol_tz_string"].';Screen='.$_SESSION["dol_screenwidth"].'x'.$_SESSION["dol_screenheight"]; + // TODO We should use a hook here, not a trigger // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; From ccddf0d1bee301e91b65128ff757dfbe997683ae Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 31 Oct 2014 16:56:14 +0100 Subject: [PATCH 075/171] Fix : actioncomme report was not filtering by entity... --- htdocs/core/modules/action/rapport.pdf.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index d595dfe5579..ea92973101f 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -182,6 +182,7 @@ class CommActionRapport $sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid"; $sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'"; $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; + $sql.= " AND a.entity = ".$conf->entity; $sql.= " ORDER BY a.datep DESC"; dol_syslog(get_class($this)."::_page sql=".$sql); From 82aa8458bf7d5f745bd21a6b7cc8d7924c236d0e Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Fri, 31 Oct 2014 17:46:11 +0100 Subject: [PATCH 076/171] Added ws url/key to thirdparty SQL table, class and info page --- htdocs/fourn/commande/card.php | 94 +++++++++++-------- .../install/mysql/migration/3.6.0-3.7.0.sql | 3 + htdocs/install/mysql/tables/llx_societe.sql | 2 + htdocs/societe/class/societe.class.php | 23 +++++ htdocs/societe/soc.php | 36 ++++++- 5 files changed, 117 insertions(+), 41 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 263a96bdca4..4ae8fb17754 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1049,8 +1049,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel')) { - $ws_host = GETPOST('ws_host','alpha'); - $ws_key = GETPOST('ws_key','alpha'); + $ws_url = $object->thirdparty->webservices_url; + $ws_key = $object->thirdparty->webservices_key; $ws_user = GETPOST('ws_user','alpha'); $ws_password = GETPOST('ws_password','alpha'); $ws_entity = GETPOST('ws_entity','int'); @@ -1069,18 +1069,20 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' //Is sync supplier web services module activated? and everything filled? if (empty($conf->syncsupplierwebservices->enabled)) { setEventMessage($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name"))); - } else if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password) || empty($ws_thirdparty))) { + } else if (empty($ws_url) || empty($ws_key)) { + setEventMessage($langs->trans("ErrorWebServicesFieldsRequired"), 'errors'); + } else if (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); } else { //Create SOAP client and connect it to order - $soapclient_order = new nusoap_client($ws_host."/webservices/server_order.php"); + $soapclient_order = new nusoap_client($ws_url."/webservices/server_order.php"); $soapclient_order->soap_defencoding='UTF-8'; $soapclient_order->decodeUTF8(false); //Create SOAP client and connect it to product/service - $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); $soapclient_product->soap_defencoding='UTF-8'; $soapclient_product->decodeUTF8(false); @@ -1123,7 +1125,11 @@ if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST(' $ws_parameters = array('authentication'=>$ws_authentication, 'order' => $order); $result_order = $soapclient_order->call("createOrder", $ws_parameters, $ws_ns, ''); - if ($result_order["result"]["result_code"] != "OK") + if (empty($result_order["result"]["result_code"])) //No result, check error str + { + setEventMessage($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", 'errors'); + } + else if ($result_order["result"]["result_code"] != "OK") //Something went wrong { setEventMessage($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", 'errors'); } @@ -1970,8 +1976,8 @@ elseif (! empty($object->id)) elseif ($action == 'webservice' && GETPOST('mode', 'alpha') != "send" && ! GETPOST('cancel')) { $mode = GETPOST('mode', 'alpha'); - $ws_host = GETPOST('ws_host','alpha'); - $ws_key = GETPOST('ws_key','alpha'); + $ws_url = $object->thirdparty->webservices_url; + $ws_key = $object->thirdparty->webservices_key; $ws_user = GETPOST('ws_user','alpha'); $ws_password = GETPOST('ws_password','alpha'); @@ -1988,7 +1994,11 @@ elseif (! empty($object->id)) print_titre($langs->trans('CreateRemoteOrder')); //Is everything filled? - if ($mode != "init" && (empty($ws_host) || empty($ws_key) || empty($ws_user) || empty($ws_password))) { + if (empty($ws_url) || empty($ws_key)) { + setEventMessage($langs->trans("ErrorWebServicesFieldsRequired"), 'errors'); + $mode = "init"; + $error_occurred = true; //Don't allow to set the user/pass if thirdparty fields are not filled + } else if ($mode != "init" && (empty($ws_user) || empty($ws_password))) { setEventMessage($langs->trans("ErrorFieldsRequired"), 'errors'); $mode = "init"; } @@ -2001,26 +2011,29 @@ elseif (! empty($object->id)) print ''; print ''; print ''; - $textinput_size = "50"; - //Remote Host URL - print ''.$langs->trans("Host").''; - - //Remote Webservices key - print ''.$langs->trans("KeyForWebServicesAccess").''; - - //Remote User - print ''.$langs->trans("User").''; - - //Remote Password - print ''.$langs->trans("Password").''; - - //Submit and cancel buttons - print ''; - print ''; - print '     '; - print ''; - print ''; + if ($error_occurred) + { + print "
    ".$langs->trans("ErrorOccurredReviseAndRetry")."
    "; + print ''; + } + else + { + $textinput_size = "50"; + // Webservice url + print ''.$langs->trans("WebServiceURL").''.dol_print_url($ws_url).''; + //Remote User + print ''.$langs->trans("User").''; + //Remote Password + print ''.$langs->trans("Password").''; + //Submit button + print ''; + print ''; + print '     '; + //Cancel button + print ''; + print ''; + } //End table/form print ''; @@ -2032,14 +2045,8 @@ elseif (! empty($object->id)) $ws_thirdparty = ''; $error_occurred = false; - //Check if has transport, without any the soap client will give error - if (strpos($ws_host, "http") === false) - { - $ws_host = "http://".$ws_host; - } - //Create SOAP client and connect it to user - $soapclient_user = new nusoap_client($ws_host."/webservices/server_user.php"); + $soapclient_user = new nusoap_client($ws_url."/webservices/server_user.php"); $soapclient_user->soap_defencoding='UTF-8'; $soapclient_user->decodeUTF8(false); @@ -2062,7 +2069,7 @@ elseif (! empty($object->id)) else { //Create SOAP client and connect it to product/service - $soapclient_product = new nusoap_client($ws_host."/webservices/server_productorservice.php"); + $soapclient_product = new nusoap_client($ws_url."/webservices/server_productorservice.php"); $soapclient_product->soap_defencoding='UTF-8'; $soapclient_product->decodeUTF8(false); @@ -2086,7 +2093,11 @@ elseif (! empty($object->id)) // Check the result code $status_code = $result_product["result"]["result_code"]; - if ($status_code != "OK") + if (empty($status_code)) //No result, check error str + { + setEventMessage($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", 'errors'); + } + else if ($status_code != "OK") //Something went wrong { if ($status_code == "NOT_FOUND") { @@ -2135,6 +2146,11 @@ elseif (! empty($object->id)) setEventMessage($langs->trans("RemoteUserNotPermission"), 'errors'); $error_occurred = true; } + elseif ($user_status_code == "BAD_CREDENTIALS") + { + setEventMessage($langs->trans("RemoteUserBadCredentials"), 'errors'); + $error_occurred = true; + } else { setEventMessage($langs->trans("ResponseNonOK")." '".$user_status_code."'", 'errors'); @@ -2146,15 +2162,13 @@ elseif (! empty($object->id)) print ''; print ''; print ''; - print ''; - print ''; print ''; print ''; print ''; print ''; if ($error_occurred) { - print "
    ".$langs->trans("ErrorOccurredReviseAndRetry")."
    "; //TODO: Translate + print "
    ".$langs->trans("ErrorOccurredReviseAndRetry")."
    "; } else { 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 c2e10543b7a..552563db677 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 @@ -1110,3 +1110,6 @@ DELETE FROM llx_menu WHERE module = 'boutique'; -- Add option always editable on extrafield ALTER TABLE llx_extrafields ADD alwayseditable INTEGER DEFAULT 0 AFTER pos; +-- add supplier webservice fields +ALTER TABLE llx_societe ADD webservices_url varchar(255) DEFAULT NULL; +ALTER TABLE llx_societe ADD webservices_key varchar(128) DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index bfe69b0d5f8..b9327ba521c 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -92,4 +92,6 @@ create table llx_societe logo varchar(255), canvas varchar(32), -- type of canvas if used (null by default) import_key varchar(14) -- import key + webservices_url varchar(255), -- supplier webservice url + webservices_key varchar(128), -- supplier webservice key )ENGINE=innodb; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6d80189c7be..79d24a8d917 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -334,6 +334,18 @@ class Societe extends CommonObject */ var $import_key; + /** + * Supplier WebServices URL + * @var string + */ + var $webservices_url; + + /** + * Supplier WebServices Key + * @var string + */ + var $webservices_key; + var $logo; var $logo_small; var $logo_mini; @@ -715,6 +727,10 @@ class Societe extends CommonObject $supplier=true; } + //Web services + $this->webservices_url = $this->webservices_url?clean_url($this->webservices_url,0):''; + $this->webservices_key = trim($this->webservices_key); + $this->db->begin(); // Check name is required and codes are ok or unique. @@ -795,6 +811,9 @@ class Societe extends CommonObject $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->default_lang."'":"null"); $sql .= ",logo = ".(! empty($this->logo)?"'".$this->logo."'":"null"); + $sql .= ",webservices_url = ".(! empty($this->webservices_url)?"'".$this->db->escape($this->webservices_url)."'":"null"); + $sql .= ",webservices_key = ".(! empty($this->webservices_key)?"'".$this->db->escape($this->webservices_key)."'":"null"); + if ($customer) { $sql .= ", code_client = ".(! empty($this->code_client)?"'".$this->db->escape($this->code_client)."'":"null"); @@ -951,6 +970,7 @@ class Societe extends CommonObject $sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_forme_juridique as forme_juridique_code'; + $sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; @@ -1086,6 +1106,9 @@ class Societe extends CommonObject $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; + $this->webservices_url = $obj->webservices_url; + $this->webservices_key = $obj->webservices_key; + $this->outstanding_limit = $obj->outstanding_limit; // multiprix diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a0b9bda1c8e..8117de5f09b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -119,7 +119,7 @@ if (empty($reshook)) $res=$object->setValueFrom('localtax2_value', $value); } - // Add new third party + // Add new or update third party if ((! GETPOST('getcustomercode') && ! GETPOST('getsuppliercode')) && ($action == 'add' || $action == 'update') && $user->rights->societe->creer) { @@ -189,6 +189,10 @@ if (empty($reshook)) $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); + // Webservices url/key + $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); + $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -217,6 +221,18 @@ if (empty($reshook)) $error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled"); $action = ($action=='add'?'create':'edit'); } + if (! empty($object->webservices_url)) { + //Check if has transport, without any the soap client will give error + if (strpos($object->webservices_url, "http") === false) + { + $object->webservices_url = "http://".$object->webservices_url; + } + if (! isValidUrl($object->webservices_url)) { + $langs->load("errors"); + $error++; $errors[] = $langs->trans("ErrorBadUrl",$object->webservices_url); + $action = ($action=='add'?'create':'edit'); + } + } // We set country_id, country_code and country for the selected country $object->country_id=GETPOST('country_id')!=''?GETPOST('country_id'):$mysoc->country_id; @@ -1179,6 +1195,10 @@ else $object->tva_intra = GETPOST('tva_intra', 'alpha'); $object->status = GETPOST('status', 'int'); + // Webservices url/key + $object->webservices_url = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL); + $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); + //Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); @@ -1558,6 +1578,14 @@ else print $object->showOptionals($extrafields,'edit'); } + // Webservices url/key + if (!empty($conf->syncsupplierwebservices->enabled)) { + print ''; + print ''; + print ''; + print ''; + } + // Logo print ''; print ''; @@ -2014,6 +2042,12 @@ else print "\n"; } + // Webservices url/key + if (!empty($conf->syncsupplierwebservices->enabled)) { + print ''.$langs->trans("WebServiceURL").''.dol_print_url($object->webservices_url).''; + print ''.$langs->trans('WebServiceKey').''.$object->webservices_key.''; + } + print ''; dol_fiche_end(); From 4951feeb8f05cdbb21e8b4f5e30d91dd57f985a4 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 07:59:52 +0100 Subject: [PATCH 077/171] Correct rights & presentation --- htdocs/accountancy/admin/account.php | 4 +- htdocs/accountancy/bookkeeping/card.php | 38 +++++----- htdocs/accountancy/bookkeeping/list.php | 70 ++++++++++++------- htdocs/accountancy/customer/card.php | 6 +- htdocs/accountancy/customer/index.php | 8 +-- htdocs/accountancy/journal/bankjournal.php | 2 - htdocs/accountancy/journal/cashjournal.php | 2 - htdocs/accountancy/journal/index.php | 2 - .../accountancy/journal/purchasesjournal.php | 2 - htdocs/accountancy/journal/sellsjournal.php | 2 - htdocs/accountancy/supplier/card.php | 7 +- htdocs/accountancy/supplier/index.php | 6 +- 12 files changed, 73 insertions(+), 76 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index fbb8cf84baa..36739254d06 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -37,7 +37,6 @@ $mesg = ''; $action = GETPOST('action'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); -$search= GETPOST("search"); $search_account = GETPOST("search_account"); $search_label = GETPOST("search_label"); $search_accountparent = GETPOST("search_accountparent"); @@ -91,7 +90,6 @@ if ($action == 'disable') { if (GETPOST("button_removefilter")) { - $search=""; $search_account=""; $search_label=""; $search_accountparent=""; @@ -169,7 +167,7 @@ if ($result) { print ' '; print ''; print ''; - print '  '; + print ' '; print ''; print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 9e109c7feeb..608c62cf1d0 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -35,8 +35,6 @@ $langs->load("accounting"); $id = GETPOST('id', 'int'); if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); $piece_num = GETPOST("piece_num"); @@ -238,7 +236,9 @@ if ($action == 'create') { print ''; print ''; -} else { +} +else +{ $book = new BookKeeping($db); $result = $book->fetch_per_mvt($piece_num); if ($result < 0) { @@ -309,14 +309,12 @@ if ($action == 'create') { print ''; print '' . $line->montant . ''; print '' . $line->sens . ''; - print ''; - if ($user->rights->accounting->access) { - print ''; - } + print ''; print ''; print ''; - } else { + } + else { print '' . $line->numero_compte . ''; print '' . $line->code_tiers . ''; print '' . $line->label_compte . ''; @@ -324,16 +322,15 @@ if ($action == 'create') { print '' . $line->credit . ''; print '' . $line->montant . ''; print '' . $line->sens . ''; - + print ''; - if ($user->rights->accouting->access) { - print ''; - print img_edit(); - print ' '; - print ''; - print img_delete(); - print ''; - } + print ''; + print img_edit(); + print ' '; + print ''; + print img_delete(); + print ''; + print ''; } print "\n"; @@ -342,7 +339,7 @@ if ($action == 'create') { if ($action == "" || $action == 'add') { $var = ! $var; print ""; - + print '
    '; print '' . "\n"; print '' . "\n"; @@ -359,14 +356,13 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; } - print ""; } } - } else { + } + else { print_fiche_titre($langs->trans("NoRecords")); } } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index b0e5096699b..21da5bacbb9 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -36,6 +36,11 @@ $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); $sortfield = GETPOST("sortfield"); $action = GETPOST('action', 'alpha'); +$search_doc_type = GETPOST("search_doc_type"); +$search_doc_ref = GETPOST("search_doc_ref"); +$search_account = GETPOST("search_account"); +$search_thirdparty = GETPOST("search_thirdparty"); +$search_journal = GETPOST("search_journal"); if ($sortorder == "") $sortorder = "ASC"; @@ -46,6 +51,15 @@ $offset = $conf->liste_limit * $page; $formventilation = new FormVentilation($db); +if (GETPOST("button_removefilter")) +{ + $search_doc_type=""; + $search_doc_ref=""; + $search_account=""; + $search_thirdparty=""; + $search_journal=""; +} + /* * Action */ @@ -100,25 +114,25 @@ else { $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; - if (dol_strlen(trim(GETPOST("search_doc_type")))) { + if (dol_strlen(trim($search_doc_type))) { - $sql .= " WHERE bk.doc_type LIKE '%" . GETPOST("search_doc_type") . "%'"; + $sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'"; - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " AND bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } } - if (dol_strlen(trim(GETPOST("search_doc_ref")))) { - $sql .= " WHERE bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'"; + if (dol_strlen(trim($search_doc_ref))) { + $sql .= " WHERE bk.doc_ref LIKE '%" . $search_doc_ref . "%'"; } - if (dol_strlen(trim(GETPOST("search_compte")))) { - $sql .= " WHERE bk.numero_compte LIKE '%" . GETPOST("search_compte") . "%'"; + if (dol_strlen(trim($search_account))) { + $sql .= " WHERE bk.numero_compte LIKE '%" . $search_account . "%'"; } - if (dol_strlen(trim(GETPOST("search_tiers")))) { - $sql .= " WHERE bk.code_tiers LIKE '%" . GETPOST("search_tiers") . "%'"; + if (dol_strlen(trim($search_thirdparty))) { + $sql .= " WHERE bk.code_tiers LIKE '%" . $search_thirdparty . "%'"; } - if (dol_strlen(trim(GETPOST("search_journal")))) { - $sql .= " WHERE bk.code_journal LIKE '%" . GETPOST("search_journal") . "%'"; + if (dol_strlen(trim($search_journal))) { + $sql .= " WHERE bk.code_journal LIKE '%" . $search_journal . "%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset); @@ -149,7 +163,7 @@ else { print ''; print '
    '; - print ""; + print '
    '; print ''; print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder); @@ -157,29 +171,31 @@ else { print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "bk.code_tiers", "", "", "", $sortfield, $sortorder); print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder); - print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder); - print_liste_field_titre(" "); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); print "\n"; print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; print ''; @@ -201,9 +217,9 @@ else { print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print "\n"; $i ++; } diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 91a0eb5df8b..28d3d0c1f79 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -40,14 +40,12 @@ $id = GETPOST('id'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * Actions */ -if ($action == 'ventil' && $user->rights->accounting->access) +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) { if (! GETPOST('cancel', 'alpha')) { @@ -109,7 +107,7 @@ if (! empty($id)) { print ''; $linkback=''.$langs->trans("Back").''; - print_fiche_titre($langs->trans('AccountingVentilationCustomer'),$linkback,'setup'); + print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup'); print '
          '; - print ''; + print ''; + print ''; + print ' '; + print ''; print '
    ' . price($obj->debit) . '' . price($obj->credit) . '' . price($obj->montant) . '' . $obj->sens . '' . $obj->sens . '' . $obj->code_journal . '' . img_edit() . '' . img_edit() . '
    '; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 9ae070c25e0..cb40b7b361b 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -93,8 +93,8 @@ if ($action == 'validatehistory') { */ llxHeader('', $langs->trans("CustomersVentilation")); -$textprevyear = "" . img_previous() . ""; -$textnextyear = " " . img_next() . ""; +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); @@ -197,7 +197,7 @@ print "
    \n"; print "
    \n"; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -212,7 +212,7 @@ print ''; print ''; print ''; -$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Total',"; +$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS 'Total',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=1,fd.total_ht,0)),2) AS 'Janvier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=2,fd.total_ht,0)),2) AS 'Fevrier',"; $sql .= " ROUND(SUM(IF(MONTH(f.datef)=3,fd.total_ht,0)),2) AS 'Mars',"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index dcd8fca4d41..1f9b0549121 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -68,8 +68,6 @@ $action = GETPOST('action'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); /* * View diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php index 8af84a9ed58..fb5a15a513c 100644 --- a/htdocs/accountancy/journal/cashjournal.php +++ b/htdocs/accountancy/journal/cashjournal.php @@ -62,8 +62,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/index.php b/htdocs/accountancy/journal/index.php index 272d76fa20f..36286ce265e 100644 --- a/htdocs/accountancy/journal/index.php +++ b/htdocs/accountancy/journal/index.php @@ -36,8 +36,6 @@ $langs->load("accountancy"); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); llxHeader('', 'Journaux', ''); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 789aa1111af..97d52124c01 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -55,8 +55,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index a7c0266998f..5bb1f989a92 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -56,8 +56,6 @@ $date_endyear = GETPOST('date_endyear'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->access) - accessforbidden(); $action = GETPOST('action'); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index b0078839b55..45c8de9b165 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -46,10 +46,9 @@ $codeventil = GETPOST('codeventil'); // Security check if ($user->societe_id > 0) accessforbidden(); -if (! $user->rights->accounting->ventilation->dispatch) - accessforbidden(); -if ($action == 'ventil' && $user->rights->accounting->access) { +if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) +{ $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql .= " SET fk_code_ventilation = " . $codeventil; $sql .= " WHERE rowid = " . $id; @@ -103,7 +102,7 @@ if ($_GET["id"]) { print ''; print ''; - print_fiche_titre($langs->trans("Ventilation")); + print_fiche_titre($langs->trans("SuppliersVentilation")); print '
    ' . $langs->trans("TotalVente") . '
    ' . $langs->trans("Total") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . '' . $langs->trans("Total") . '
    '; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 7d633c575f1..edebcfd9d46 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -92,10 +92,10 @@ if ($action == 'validatehistory') { llxHeader('', $langs->trans("SuppliersVentilation")); -$textprevyear = "" . img_previous() . ""; -$textnextyear = " " . img_next() . ""; +$textprevyear = '' . img_previous() . ''; +$textnextyear = ' ' . img_next() . ''; -print_fiche_titre($langs->trans("AccountingVentilationSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); +print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear); print '' . $langs->trans("DescVentilSupplier") . ''; print ''; From abfa1a5fde9f4c73692343413a3ac54c35901200 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 14:28:28 +0100 Subject: [PATCH 078/171] cheque list --- htdocs/compta/paiement/cheque/list.php | 32 ++++++++++++++++++-------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 1699656acb1..08284e2796e 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -38,6 +38,9 @@ $langs->load("bills"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'banque', '',''); +$search_ref = GETPOST('search_ref','int'); +$search_account = GETPOST('search_account','int'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -57,6 +60,16 @@ $formother = new FormOther($db); $checkdepositstatic=new RemiseCheque($db); $accountstatic=new Account($db); +// If click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $search_ref=''; + $search_amount=''; + $search_account=''; + $year=''; + $month=''; +} + /* * View */ @@ -72,9 +85,9 @@ $sql.= " WHERE bc.fk_bank_account = ba.rowid"; $sql.= " AND bc.entity = ".$conf->entity; // Search criteria -if (GETPOST("search_ref")) $sql.=" AND bc.number=".GETPOST("search_ref",'int'); -if (GETPOST("search_account") > 0) $sql.=" AND bc.fk_bank_account=".GETPOST("search_account",'int'); -if (GETPOST("search_amount")) $sql.=" AND bc.amount=".price2num(GETPOST("search_amount")); +if ($search_ref) $sql.=" AND bc.number=".$search_ref; +if ($search_account > 0) $sql.=" AND bc.fk_bank_account=".$search_account; +if ($search_amount) $sql.=" AND bc.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($month > 0) { if ($year > 0 && empty($day)) @@ -117,7 +130,7 @@ if ($resql) // Lignes des champs de filtre print ''; print ''; print ''; print ''; print ''; print ''; - print ''; - print "\n"; + print '\n"; $var=true; while ($i < min($num,$limit)) From 9e07c3a7b690c263e2c3d0c92c9d8e7427fed7de Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 14:51:52 +0100 Subject: [PATCH 079/171] Typo --- htdocs/compta/paiement/cheque/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 08284e2796e..63923d6a3ce 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -116,7 +116,7 @@ if ($resql) print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num); - print '
    '; + print ''; print '
    '; - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -125,16 +138,15 @@ if ($resql) $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; - $form->select_comptes($_REQUEST["search_account"],'search_account',0,'',1); + $form->select_comptes($search_account,'search_account',0,'',1); print ' '; - print ''; + print ''; print ''; - print ''; - print '
    '; + print ''; + print "
    '; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bc.number","",$params,"",$sortfield,$sortorder); From a0d3dbd93ca0fdf7a2e0a496acf61d7065ad23a0 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 14:52:05 +0100 Subject: [PATCH 080/171] Social Contrib list --- htdocs/compta/sociales/index.php | 43 ++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 022aaf14ff0..b280fbdc2c2 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -36,6 +36,9 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -65,6 +68,16 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; + $year=""; + $month=""; + $filtre=""; +} /* * View @@ -85,7 +98,11 @@ $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND cs.libelle LIKE '%".$db->escape(GETPOST("search_label"))."%'"; + +// Search criteria +if ($search_ref) $sql.=" AND cs.rowid=".$search_ref; +if ($search_label) $sql.=" AND cs.libelle LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND cs.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($year > 0) { $sql .= " AND ("; @@ -139,10 +156,8 @@ if ($resql) { print ''; - - print "
    "; - - print ""; + print '
    '; + print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); @@ -153,20 +168,26 @@ if ($resql) print "\n"; print ''; - print ''; - print ''; + // Ref + print ''; + // Label + print ''; // Type print ''; // Period end date print ''; - print ''; - print ''; + // Amount print ''; - print "\n"; + print ''; + print '\n"; while ($i < min($num,$limit)) { From 5122b32cccbc3ff9cdbb7de94e9659e408043420 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 14:59:39 +0100 Subject: [PATCH 081/171] Salaries list --- htdocs/compta/salaries/index.php | 36 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index b2fc3e1b4a3..8382029aa56 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -33,6 +33,9 @@ $socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'salaries', '', '', ''); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -61,6 +64,14 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; +} + /* * View */ @@ -78,8 +89,11 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.rowid = s.fk_user"; $sql.= " AND s.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND s.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; -if (GETPOST("search_amount")) $sql.=" AND s.amount = ".price2num(GETPOST("search_amount")); + +// Search criteria +if ($search_ref) $sql.=" AND s.rowid=".$search_ref; +if ($search_label) $sql.=" AND s.label LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND s.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; @@ -118,19 +132,23 @@ if ($result) print "\n"; print ''; + // Ref + print ''; print ''; - print ''; - print ''; + // Label + print ''; print ''; // Type print ''; - print ''; - print ''; - print "\n"; + // Amount + print ''; + print '\n"; while ($i < min($num,$limit)) { From 26c63f3ea48a4d75d54c9479c226416436d7e792 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 1 Nov 2014 15:06:46 +0100 Subject: [PATCH 082/171] donation list --- htdocs/compta/dons/list.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/dons/list.php b/htdocs/compta/dons/list.php index badc71c96e2..174b5357bb2 100644 --- a/htdocs/compta/dons/list.php +++ b/htdocs/compta/dons/list.php @@ -43,12 +43,20 @@ if (! $sortfield) $sortfield="d.datedon"; $limit = $conf->liste_limit; $statut=isset($_GET["statut"])?$_GET["statut"]:"-1"; -$search_ref=GETPOST('search_ref'); -$search_company=GETPOST('search_company'); -$search_name=GETPOST('search_name'); +$search_ref=GETPOST('search_ref','alpha'); +$search_company=GETPOST('search_company','alpha'); +$search_name=GETPOST('search_name','alpha'); +$search_amount = GETPOST('search_amount','alpha'); if (!$user->rights->don->lire) accessforbidden(); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_company=""; + $search_name=""; + $search_amount=""; +} /* * View @@ -82,6 +90,8 @@ if (trim($search_name) != '') { $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name); } +if ($search_amount) $sql.=" AND d.amount='".$db->escape(price2num(trim($search_amount)))."'"; + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -141,11 +151,10 @@ if ($resql) print ' '; print ''; } - print ''; + print ''; print '\n"; + print ''; + print "\n"; $var=True; while ($i < min($num,$limit)) From 53dfda1413069c1e8f4979a171be5a72053030fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 19:34:20 +0100 Subject: [PATCH 083/171] Fix: Chars - is no more allowed into value for code for extra fields. --- ChangeLog | 3 ++- htdocs/core/class/extrafields.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index abbe486707f..28d86310494 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,8 @@ English Dolibarr ChangeLog - Fix: box of customer and propsects were not correctly disabled. - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode - Fix: Civility & birthdate wasn't save into adherent module. -- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: Chars - is no more allowed into value for code for extra fields. ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 16583c0703c..8ce0a1b3b45 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -154,7 +154,7 @@ class ExtraFields { $table=$elementtype.'_extrafields'; - if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname)) + if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname)) { if ($type=='boolean') { $typedb='int'; From b8faed9fe80700c2be56ca3f7469277cf9a41352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 19:50:56 +0100 Subject: [PATCH 084/171] Fix: translation --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/holiday.lang | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 59b31693b2b..82a80881fd0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -514,8 +514,8 @@ Module5000Name=Multi-company Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow Module6000Desc=Workflow management -Module20000Name=Holidays -Module20000Desc=Declare and follow employees holidays +Module20000Name=Leave Requests management +Module20000Desc=Declare and follow employees leaves requests Module39000Name=Product batch Module39000Desc=Batch number, eat-by and sell-by date management on products Module50000Name=PayBox diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index c25abf6449c..698d34eb539 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -52,16 +52,16 @@ UpdateButtonCP=Update CantUpdate=You cannot update this leave request. NoDateDebut=You must select a start date. NoDateFin=You must select an end date. -ErrorDureeCP=Your request for holidays does not contain working day. -TitleValidCP=Approve the request holidays +ErrorDureeCP=Your leave request does not contain working day. +TitleValidCP=Approve the leave request ConfirmValidCP=Are you sure you want to approve the leave request? DateValidCP=Date approved TitleToValidCP=Send leave request ConfirmToValidCP=Are you sure you want to send the leave request? -TitleRefuseCP=Refuse the request holidays +TitleRefuseCP=Refuse the leave request ConfirmRefuseCP=Are you sure you want to refuse the leave request? NoMotifRefuseCP=You must choose a reason for refusing the request. -TitleCancelCP=Cancel the request holidays +TitleCancelCP=Cancel the leave request ConfirmCancelCP=Are you sure you want to cancel the leave request? DetailRefusCP=Reason for refusal DateRefusCP=Date of refusal @@ -78,7 +78,7 @@ ActionByCP=Performed by UserUpdateCP=For the user PrevSoldeCP=Previous Balance NewSoldeCP=New Balance -alreadyCPexist=A request for holidays has already been done on this period. +alreadyCPexist=A leave request has already been done on this period. UserName=Name Employee=Employee FirstDayOfHoliday=First day of vacation @@ -88,25 +88,25 @@ ManualUpdate=Manual update HolidaysCancelation=Leave request cancelation ## Configuration du Module ## -ConfCP=Configuration of holidays module +ConfCP=Configuration of leave request module DescOptionCP=Description of the option ValueOptionCP=Value -GroupToValidateCP=Group with the ability to approve vacation +GroupToValidateCP=Group with the ability to approve leave requests ConfirmConfigCP=Validate the configuration -LastUpdateCP=Last automatic update of vacation +LastUpdateCP=Last automatic update of leaves allocation UpdateConfCPOK=Updated successfully. ErrorUpdateConfCP=An error occurred during the update, please try again. -AddCPforUsers=Please add the balance of holidays of users by clicking here. -DelayForSubmitCP=Deadline to apply for holidays -AlertapprobatortorDelayCP=Prevent the approbator if the holiday request does not match the deadline +AddCPforUsers=Please add the balance of leaves allocation of users by clicking here. +DelayForSubmitCP=Deadline to make a leave requests +AlertapprobatortorDelayCP=Prevent the approbator if the leave request does not match the deadline AlertValidatorDelayCP=Préevent the approbator if the leave request exceed delay AlertValidorSoldeCP=Prevent the approbator if the leave request exceed the balance nbUserCP=Number of users supported in the module Leaves -nbHolidayDeductedCP=Number of holidays to be deducted per day of vacation taken -nbHolidayEveryMonthCP=Number of vacation days added every month +nbHolidayDeductedCP=Number of leave days to be deducted per day of vacation taken +nbHolidayEveryMonthCP=Number of leave days added every month Module27130Name= Management of leave requests Module27130Desc= Management of leave requests -TitleOptionMainCP=Main settings of Leave request +TitleOptionMainCP=Main settings of leave request TitleOptionEventCP=Settings of leave requets for events ValidEventCP=Validate UpdateEventCP=Update events From 762eb1cd48ad07ee4512391f2ac3cc551ad41aed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 20:04:01 +0100 Subject: [PATCH 085/171] Style were lost --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/theme/eldy/img/background.png | Bin 0 -> 25628 bytes htdocs/theme/eldy/style.css.php | 31 ++++++++++++++++----------- 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 htdocs/theme/eldy/img/background.png diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 82a80881fd0..00f7ae43737 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -522,8 +522,8 @@ Module50000Name=PayBox Module50000Desc=Module to offer an online payment page by credit card with PayBox Module50100Name=Point of sales Module50100Desc=Point of sales module -Module50200Name= Paypal -Module50200Desc= Module to offer an online payment page by credit card with Paypal +Module50200Name=Paypal +Module50200Desc=Module to offer an online payment page by credit card with Paypal Module50400Name=Accounting (advanced) Module50400Desc=Accounting management (double parties) Module54000Name=PrintIPP diff --git a/htdocs/theme/eldy/img/background.png b/htdocs/theme/eldy/img/background.png new file mode 100644 index 0000000000000000000000000000000000000000..fb63f12299c1e94af1bdccaf930065b210b834dc GIT binary patch literal 25628 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 U`K5o~IsRvV)%gm>_U@Da1L( background: ; - /* background-image: url(""); */ color: #101010; font-size: px; @@ -831,10 +830,10 @@ foreach($mainmenuusedarray as $val) .bodylogin { - background: #f0f0f0; - /*-moz-box-shadow: inset 0 0 10px #000000; + background: #fbfbfb; + /* -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; @@ -861,17 +860,23 @@ form#login { padding-top:12px; padding-bottom:12px; max-width: 540px; - border: 1px solid #A0A0A0; + + border: 1px solid #C0C0C0; + background-color: #E0E0E0; + + -moz-box-shadow: 3px 2px 20px #CCC; + -webkit-box-shadow: 3px 2px 20px #CCC; + box-shadow: 3px 2px 20px #CCC; border-radius: 8px; - border:solid 1px rgba(90,90,90,.4); - -moz-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - -webkit-box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(60,60,60,0.15); - - background-color: #FFFFFF; - background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #fff), color-stop(100%, #f8f8f8)); - background: -moz-linear-gradient(top, #fff, #f8f8f8); + border:solid 1px rgba(128,128,128,.4); + border-top:solid 1px f8f8f8; + background-color: #f8f8f8; + background-image: -o-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -moz-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -webkit-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: -ms-linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); + background-image: linear-gradient(top, rgba(250,250,250,.6) 0%, rgba(192,192,192,.3) 100%); } div#login_left, div#login_right { display: inline-block; From 167ec6917a30e8362860229d49d974a1eed746f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 20:15:51 +0100 Subject: [PATCH 086/171] Can add prefix into generated filename. This will save time for script to build kit of files for book keeper. --- htdocs/core/lib/invoice2.lib.php | 18 ++++++------------ scripts/invoices/rebuild_merge_pdf.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index d5be39aff0f..ccc115b5b1d 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -41,12 +41,13 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); * @param date $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template - * @param string $option Suffix to add into file name of generated PDF + * @param string $filesuffix Suffix to add into file name of generated PDF * @param string $paymentbankid Only if payment on this bank account id * @param array $thirdpartiesid List of thirdparties id when using filter excludethirdpartiesid or onlythirdpartiesid + * @param string $fileprefix Prefix to add into filename of generated PDF * @return int Error code */ -function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $option='', $paymentbankid='', $thirdpartiesid='') +function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $filesuffix='', $paymentbankid='', $thirdpartiesid='', $fileprefix='mergedpdf') { $sql = "SELECT DISTINCT f.rowid, f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; @@ -220,13 +221,6 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); //$pdf->SetCompression(false); - - //$pdf->Open(); - //$pdf->AddPage(); - //$title=$langs->trans("BillsCustomersUnpaid"); - //if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid"); - //$pdf->MultiCell(100, 3, $title, 0, 'J'); - // Add all others foreach($files as $file) { @@ -248,9 +242,9 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte dol_mkdir($diroutputpdf); // Save merged file - $filename='mergedpdf'; - - if (! empty($option)) $filename.='_'.$option; + $filename=$fileprefix; + if (empty($filename)) $filename='mergedpdf'; + if (! empty($filesuffix)) $filename.='_'.$filesuffix; $file=$diroutputpdf.'/'.$filename.'.pdf'; if (! $error && $pagecount) diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 357a09ccdbe..6fbcdb59538 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -71,6 +71,7 @@ $newlangid='en_EN'; // To force a new lang id $filter=array(); $regenerate=''; // Ask regenerate (contains name of model to use) $option=''; +$fileprefix='mergedpdf'; foreach ($argv as $key => $value) { @@ -84,6 +85,13 @@ foreach ($argv as $key => $value) $newlangid=$valarray[1]; print 'Use language '.$newlangid.".\n"; } + if (preg_match('/^prefix=/i',$value)) + { + $found=true; + $valarray=explode('=',$value); + $fileprefix=$valarray[1]; + print 'Use prefix for filename '.$fileprefix.".\n"; + } if (preg_match('/^regenerate=(.*)/i',$value,$reg)) { @@ -232,7 +240,7 @@ if (in_array('bank',$filter) && in_array('nopayment',$filter)) // Define SQL and SQL request to select invoices // Use $filter, $dateafterdate, datebeforedate, $paymentdateafter, $paymentdatebefore -$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option, $paymentonbankid, $thirdpartiesid); +$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option, $paymentonbankid, $thirdpartiesid, $fileprefix); @@ -283,6 +291,7 @@ function usage() print "To limit to some thirdparties, use filter=onlythirdparties id1,id2...\n"; print "To regenerate existing PDF, use regenerate=crabe\n"; print "To generate invoices in a language, use lang=xx_XX\n"; + print "To set prefix of generated file name, use prefix=myfileprefix\n"; print "\n"; print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=crabe\n"; print "Example: ".$script_file." filter=all lang=en_US\n"; From 5586893ca2ed4b6ad357f55edd1874fc7ec327b2 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 1 Nov 2014 21:00:28 +0100 Subject: [PATCH 087/171] Update odf.php add new fonction getvalue (valuename) return value inside [valuename][/valuename] tag --- htdocs/includes/odtphp/odf.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 225466ca453..d4b79af8013 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -610,6 +610,21 @@ IMG; closedir($handle); } } + + /** + * return the value present on odt in [valuename][/valuename] + * @param string $value name balise in the template + * @return string the value inside the balise + * + */ + public function getvalue($valuename) + { + $searchreg="/\\[".$valuename."\\](.*)\\[\\/".$valuename."\\]/"; + preg_match($searchreg, $this->contentXml, $matches); + $this->contentXml = preg_replace($searchreg, "", $this->contentXml); + return $matches[1]; + } + } ?> From f23f16da861d128c7f1e2e355fbfd151a0c7b4ac Mon Sep 17 00:00:00 2001 From: frederic34 Date: Sat, 1 Nov 2014 21:38:50 +0100 Subject: [PATCH 088/171] Try to improve stock display for all stock increase/decrease options --- htdocs/langs/en_US/sendings.lang | 2 + htdocs/langs/fr_FR/sendings.lang | 2 + htdocs/product/class/product.class.php | 78 ++++++++++++--------- htdocs/product/stock/product.php | 95 ++++++++++++++------------ 4 files changed, 100 insertions(+), 77 deletions(-) diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 2ae43f39766..855fced7310 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is do RelatedShippings=Related shippings ShipmentLine=Shipment line CarrierList=List of transporters +SendingRunning=Product from customer order already sent +SuppliersReceiptRunning=Product from supplier order alrady received # Sending methods SendingMethodCATCH=Catch by customer diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang index 47b359318e4..59c937c97b6 100644 --- a/htdocs/langs/fr_FR/sendings.lang +++ b/htdocs/langs/fr_FR/sendings.lang @@ -61,6 +61,8 @@ ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle exp RelatedShippings=Expédition(s) associée(s) ShipmentLine=Ligne d'expédition CarrierList=Liste des transporteurs +SendingRunning=Produits de commandes clients déjà expédiés +SuppliersReceiptRunning=Produit de commandes fournisseurs déjà réceptionnés # Sending methods SendingMethodCATCH=Enlèvement par le client diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 226a3501652..98b5d155ba7 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3032,42 +3032,56 @@ class Product extends CommonObject * * @return int < 0 if KO, > 0 if OK */ - function load_virtual_stock() - { - global $conf; + function load_virtual_stock() + { + global $conf; - if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) - { - $stock_commande_client=$stock_commande_fournisseur=0; - $stock_sending_client=$stock_reception_fournisseur=0; + $stock_commande_client=0; + $stock_commande_fournisseur=0; + $stock_sending_client=0; + $stock_reception_fournisseur=0; - if (! empty($conf->commande->enabled)) - { - $result=$this->load_stats_commande(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_commande_client=$this->stats_commande['qty']; - } - if (! empty($conf->expedition->enabled)) - { - $result=$this->load_stats_sending(0,'1,2'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_sending_client=$this->stats_expedition['qty']; - } - if (! empty($conf->fournisseur->enabled)) - { - $result=$this->load_stats_commande_fournisseur(0,'3'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; + if (! empty($conf->commande->enabled)) { + $result=$this->load_stats_commande(0,'1,2'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_commande_client=$this->stats_commande['qty']; + } + if (! empty($conf->expedition->enabled)) { + $result=$this->load_stats_sending(0,'1,2'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_sending_client=$this->stats_expedition['qty']; + } + if (! empty($conf->fournisseur->enabled)) { + $result=$this->load_stats_commande_fournisseur(0,'3,4'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_commande_fournisseur=$this->stats_commande_fournisseur['qty']; - $result=$this->load_stats_reception(0,'3'); - if ($result < 0) dol_print_error($db,$this->error); - $stock_reception_fournisseur=$this->stats_reception['qty']; - } + $result=$this->load_stats_reception(0,'4'); + if ($result < 0) dol_print_error($db,$this->error); + $stock_reception_fournisseur=$this->stats_reception['qty']; + } - $this->stock_theorique=$this->stock_reel-($stock_commande_client-$stock_sending_client)+($stock_commande_fournisseur-$stock_reception_fournisseur); - //echo $this->stock_theorique.' = '.$this->stock_reel.' - ('.$stock_commande_client.' - '.$stock_sending_client.') + ('.$stock_commande_fournisseur.' - '.$stock_reception_fournisseur.')'; - } - } + // Stock decrease mode + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + $this->stock_theorique=$this->stock_reel-$stock_commande_client+$stock_sending_client; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)) { + $this->stock_theorique=$this->stock_reel; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { + $this->stock_theorique=$this->stock_reel-$stock_commande_client; + } + // Stock Increase mode + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + $this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { + $this->stock_theorique-=$stock_reception_fournisseur; + } + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { + $this->stock_theorique+=$stock_commande_fournisseur-$stock_reception_fournisseur; + } + } /** * Move an uploaded file described into $file array into target directory $sdir. diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7885553095e..22dc080d6e2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -39,6 +39,7 @@ $langs->load("products"); $langs->load("orders"); $langs->load("bills"); $langs->load("stocks"); +$langs->load("sendings"); if (! empty($conf->productbatch->enabled)) $langs->load("productbatch"); @@ -331,58 +332,62 @@ if ($id > 0 || $ref) print ''; print ''; - // Calculating a theorical value + // Calculating a theorical value + print ''; + print "'; + print ''; - // If stock if stock increment is done on real sending - if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) - { - // Stock theorique - print ''; - print "'; - print ''; + print ''; + print ''; - print ''; - } + // Number of supplier order running + if (! empty($conf->fournisseur->enabled)) { + if ($found) print '
    '; else $found=1; + $result=$product->load_stats_commande_fournisseur(0,'3,4'); + print $langs->trans("SuppliersOrdersRunning").': '.$product->stats_commande_fournisseur['qty']; + $result=$product->load_stats_commande_fournisseur(0,'0,1,2'); + if ($result < 0) dol_print_error($db,$product->error); + print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')'; + } - // If stock if stock increment is done on - // TODO Add information when stock increment is done on other option - - // TODO Add also information on possible decrease stock accroding to stock decrease option + // Number of product from supplier order already received (partial receipt) + if (! empty($conf->fournisseur->enabled)) { + if ($found) print '
    '; else $found=1; + print $langs->trans("SuppliersReceiptRunning").': '.$product->stats_reception['qty']; + } + print ''; // Last movement $sql = "SELECT max(m.datem) as datem"; From 77f1e587e63f4bb4b34f64ff8c553e5f33eb0123 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Sat, 1 Nov 2014 22:08:18 +0100 Subject: [PATCH 089/171] Some translations --- htdocs/langs/en_US/sendings.lang | 2 +- htdocs/langs/fr_FR/deliveries.lang | 2 ++ htdocs/langs/fr_FR/sendings.lang | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 855fced7310..f6111bac684 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -62,7 +62,7 @@ RelatedShippings=Related shippings ShipmentLine=Shipment line CarrierList=List of transporters SendingRunning=Product from customer order already sent -SuppliersReceiptRunning=Product from supplier order alrady received +SuppliersReceiptRunning=Product from supplier order already received # Sending methods SendingMethodCATCH=Catch by customer diff --git a/htdocs/langs/fr_FR/deliveries.lang b/htdocs/langs/fr_FR/deliveries.lang index 4f61426e83c..02dd54275f6 100644 --- a/htdocs/langs/fr_FR/deliveries.lang +++ b/htdocs/langs/fr_FR/deliveries.lang @@ -24,3 +24,5 @@ Deliverer=Livreur(s) : Sender=Expéditeur Recipient=Destinataire ErrorStockIsNotEnough=Le stock est insuffisant +Shippable=Expédiable +NonShippable=Non Expédiable diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang index 59c937c97b6..3f839ba9416 100644 --- a/htdocs/langs/fr_FR/sendings.lang +++ b/htdocs/langs/fr_FR/sendings.lang @@ -62,7 +62,7 @@ RelatedShippings=Expédition(s) associée(s) ShipmentLine=Ligne d'expédition CarrierList=Liste des transporteurs SendingRunning=Produits de commandes clients déjà expédiés -SuppliersReceiptRunning=Produit de commandes fournisseurs déjà réceptionnés +SuppliersReceiptRunning=Produits de commandes fournisseurs déjà réceptionnés # Sending methods SendingMethodCATCH=Enlèvement par le client From 98299f88e8c26ae4841d0658157b5120c8a7e104 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 08:12:34 +0100 Subject: [PATCH 090/171] Suppliers list --- htdocs/fourn/facture/list.php | 89 ++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 34 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9439fc534bd..7ce928caa06 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -64,8 +64,14 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="fac.datef,fac.rowid"; -$month = GETPOST('month','int'); -$year = GETPOST('year','int'); +$search_ref = GETPOST("search_ref","int"); +$search_ref_supplier = GETPOST("search_ref_supplier","alpha"); +$search_label = GETPOST("search_label","alpha"); +$search_company = GETPOST("search_company","alpha"); +$search_amount_no_tax = GETPOST("search_amount_no_tax","alpha"); +$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha"); +$month = GETPOST("month","int"); +$year = GETPOST("year","int"); /* @@ -93,8 +99,17 @@ if ($mode == 'search') } } - - +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_label=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; + $year=""; + $month=""; +} /* * View @@ -132,14 +147,14 @@ if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a } } -if (GETPOST("search_ref")) +if ($search_ref) { - if (is_numeric(GETPOST("search_ref"))) $sql .= natural_search(array('fac.rowid', 'fac.ref'), GETPOST('search_ref'));// For backward compatibility - else $sql .= natural_search('fac.ref', GETPOST("search_ref")); + if (is_numeric($search_ref)) $sql .= natural_search(array('fac.rowid', 'fac.ref'), $search_ref);// For backward compatibility + else $sql .= natural_search('fac.ref', $search_ref); } -if (GETPOST("search_ref_supplier")) +if (search_ref_supplier) { - $sql .= natural_search('fac.ref_supplier', GETPOST('search_ref_supplier')); + $sql .= natural_search('fac.ref_supplier', $search_ref_supplier); } if ($month > 0) { @@ -152,24 +167,24 @@ else if ($year > 0) { $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } -if (GETPOST("search_libelle")) +if ($search_label) { - $sql .= natural_search('fac.libelle', GETPOST('search_libelle')); + $sql .= natural_search('fac.libelle', $search_label); } -if (GETPOST("search_societe")) +if ($search_company) { - $sql .= natural_search('s.nom', GETPOST('search_societe')); + $sql .= natural_search('s.nom', $search_company); } -if (GETPOST("search_montant_ht")) +if ($search_amount_no_tax) { - $sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'"; + $sql .= " AND fac.total_ht = '".$db->escape(price2num($search_amount_no_tax))."'"; } -if (GETPOST("search_montant_ttc")) +if ($search_amount_all_tax) { - $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'"; + $sql .= " AND fac.total_ttc = '".$db->escape(price2num($search_amount_all_tax))."'"; } $nbtotalofrecords = 0; @@ -195,14 +210,14 @@ if ($resql) } $param='&socid='.$socid; - if ($month) $param.='&month='.urlencode($month); - if ($year) $param.='&year=' .urlencode($year); - if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref")); - if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier")); - if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle")); - if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe")); - if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht")); - if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc")); + if ($month) $param.='&month='.urlencode($month); + if ($year) $param.='&year=' .urlencode($year); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier); + if ($search_label) $param.='&search_label='.urlencode($search_label); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); + if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre")); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); @@ -218,17 +233,18 @@ if ($resql) 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); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye","",$param,'align="right"',$sortfield,$sortorder); + print ''; print "\n"; // Lignes des champs de filtre print ''; print ''; print ''; print ''; print ''; print ''; print ''; if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) { @@ -250,13 +266,15 @@ if ($resql) print ''; } print ''; print "\n"; @@ -312,6 +330,8 @@ if ($resql) //print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am); print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5); print ''; + + print ''; print "\n"; $i++; @@ -325,6 +345,7 @@ if ($resql) print ''; print ''; print ''; + print ''; print "\n"; } } From e48350fdc187e2c406905bb2159371e78f9afd84 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 08:33:39 +0100 Subject: [PATCH 091/171] Unpayed suppliers invoices list --- htdocs/fourn/facture/impayees.php | 78 +++++++++++++++---------------- htdocs/fourn/facture/list.php | 23 +++++---- 2 files changed, 50 insertions(+), 51 deletions(-) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index a80cb00f2d3..3253a79fcd8 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -47,6 +47,31 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); + +$search_ref = GETPOST('search_ref','alpha'); +$search_ref_supplier = GETPOST('search_ref_supplier','alpha'); +$search_company = GETPOST('search_company','alpha'); +$search_amount_no_tax = GETPOST('search_amount_no_tax','alpha'); +$search_amount_all_tax = GETPOST('search_amount_all_tax','alpha'); + +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="f.date_lim_reglement"; +if (! $sortorder) $sortorder="ASC"; + +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; +} /* * View @@ -61,31 +86,6 @@ $title=$langs->trans("BillsSuppliersUnpaid"); $facturestatic=new FactureFournisseur($db); $companystatic=new Societe($db); - -/*************************************************************************** -* * -* Mode Liste * -* * -***************************************************************************/ - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); - -$search_ref = GETPOST('search_ref','alpha'); -$search_ref_supplier = GETPOST('search_ref_supplier','alpha'); -$search_societe = GETPOST('search_societe','alpha'); -$search_montant_ht = GETPOST('search_montant_ht','int'); -$search_montant_ttc = GETPOST('search_montant_ttc','int'); - - -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortfield) $sortfield="f.date_lim_reglement"; -if (! $sortorder) $sortorder="ASC"; - if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.rowid as socid, s.nom as name,"; @@ -124,19 +124,19 @@ if ($user->rights->fournisseur->facture->lire) $sql .= " AND f.ref_supplier LIKE '%".$search_ref_supplier."%'"; } - if ($search_societe) + if ($search_company) { - $sql .= " AND s.nom LIKE '%".$search_societe."%'"; + $sql .= " AND s.nom LIKE '%".$search_company."%'"; } - if ($search_montant_ht) + if ($search_amount_no_tax) { - $sql .= " AND f.total_ht = '".$search_montant_ht."'"; + $sql .= " AND f.total_ht = '".$search_amount_no_tax."'"; } - if ($search_montant_ttc) + if ($search_amount_all_tax) { - $sql .= " AND f.total_ttc = '".$search_montant_ttc."'"; + $sql .= " AND f.total_ttc = '".$search_amount_all_tax."'"; } if (dol_strlen(GETPOST('sf_re')) > 0) @@ -165,9 +165,9 @@ if ($user->rights->fournisseur->facture->lire) if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref_supplier) $param.='&search_ref_supplier='.urlencode($search_ref_supplier); - if ($search_societe) $param.='&search_societe='.urlencode($search_societe); - if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); - if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); + if ($search_company) $param.='&search_company='.urlencode($search_company); + if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); + if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); $param.=($option?"&option=".$option:""); if (! empty($late)) $param.='&late='.urlencode($late); @@ -209,15 +209,15 @@ if ($user->rights->fournisseur->facture->lire) print ''; print ''; print ''; - print "\n"; + print ''; + print "\n"; if ($num > 0) { diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 7ce928caa06..616e9690e8a 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -73,6 +73,17 @@ $search_amount_all_tax = GETPOST("search_amount_all_tax","alpha"); $month = GETPOST("month","int"); $year = GETPOST("year","int"); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_ref_supplier=""; + $search_label=""; + $search_company=""; + $search_amount_no_tax=""; + $search_amount_all_tax=""; + $year=""; + $month=""; +} /* * Actions @@ -99,18 +110,6 @@ if ($mode == 'search') } } -if (GETPOST("button_removefilter")) -{ - $search_ref=""; - $search_ref_supplier=""; - $search_label=""; - $search_company=""; - $search_amount_no_tax=""; - $search_amount_all_tax=""; - $year=""; - $month=""; -} - /* * View */ From 64b9299eb6a96accf742d8bc4726557a8db73bba Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 08:45:42 +0100 Subject: [PATCH 092/171] Suppliers invoice payment list --- htdocs/fourn/facture/paiement.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 831749b1904..33691cb7942 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -458,6 +458,15 @@ if (empty($action)) $search_paymenttype=GETPOST('search_paymenttype'); $search_amount=GETPOST('search_amount'); $search_company=GETPOST('search_company'); + + if (GETPOST("button_removefilter")) + { + $search_ref=""; + $search_account=""; + $search_paymenttype=""; + $search_amount=""; + $search_company=""; + } $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,'; $sql.= ' s.rowid as socid, s.nom as name,'; @@ -548,8 +557,9 @@ if (empty($action)) print ''; print ''; + print ''; + print ''; + print ''; print "\n"; while ($i < min($num,$limit)) From b74bdb8f7d08bf192b129b514145cfdc48ca19f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 11:39:30 +0100 Subject: [PATCH 093/171] Fix: Bad error message --- htdocs/commande/card.php | 14 +++----------- htdocs/compta/facture.php | 18 ++++++------------ htdocs/core/lib/functions.lib.php | 6 +++++- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 47dfb568c78..d575c8089f0 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1295,18 +1295,10 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G setEventMessage($mesg, 'errors'); } } - /* } - else - { - $langs->load("other"); - $mesg='
    '.$langs->trans('ErrorMailRecipientIsEmpty').' !
    '; - $action='presend'; - dol_syslog('Recipient email is empty'); - }*/ } else { - $langs->load("errors"); - setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors'); - dol_syslog('Failed to read file: ' . $file); + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); } } else { $langs->load("other"); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 58001d5c918..8e618663237 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1615,8 +1615,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtoid = $_POST['receiver']; } } - - if (dol_strlen($sendto)) { + + if (dol_strlen($sendto)) + { $langs->load("commercial"); $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; @@ -1715,17 +1716,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO setEventMessage($mesg, 'errors'); } } - /* } - else - { - $langs->load("other"); - $mesgs[]='
    '.$langs->trans('ErrorMailRecipientIsEmpty').'
    '; - dol_syslog('Recipient email is empty'); - }*/ } else { - $langs->load("errors"); - setEventMessage($langs->trans('ErrorCantReadFile', $file), 'errors'); - dol_syslog('Failed to read file: ' . $file); + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty') . '!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); } } else { $langs->load("other"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 23092acfd0d..a94a77f1454 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2862,7 +2862,11 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou $listofcurrenciesbefore=array('USD'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); - else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code); + else + { + $tmpcur=$outlangs->getCurrencySymbol($currency_code); + $cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur); + } } $output=$cursymbolbefore.$output.$end.$cursymbolafter; From 5086450f35176f392485ea4739ccf8ebae50e162 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 12:32:38 +0100 Subject: [PATCH 094/171] Fix: Forging email content must use dol_concatdesc. --- htdocs/comm/propal.php | 9 +++--- htdocs/commande/card.php | 9 +++--- htdocs/compta/facture.php | 32 ++++++------------- htdocs/compta/facture/impayees.php | 9 +++--- htdocs/core/actions_sendmails.inc.php | 11 ++++--- htdocs/core/class/interfaces.class.php | 3 +- .../core/triggers/dolibarrtriggers.class.php | 3 +- ...terface_50_modAgenda_ActionsAuto.class.php | 2 +- htdocs/expedition/card.php | 9 +++--- htdocs/fichinter/card.php | 9 +++--- htdocs/fourn/commande/card.php | 9 +++--- htdocs/fourn/facture/card.php | 9 +++--- 12 files changed, 56 insertions(+), 58 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6281b1f25f4..189f1f9c041 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -617,11 +617,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else $subject = $langs->transnoentities('Propal') . ' ' . $object->ref; $actiontypecode = 'AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d575c8089f0..792da64a923 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1225,11 +1225,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else $subject = $langs->transnoentities('Order') . ' ' . $object->ref; $actiontypecode = 'AC_COM'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2 = $langs->transnoentities('Action' . $actiontypecode); } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8e618663237..2ba425f5a90 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1627,31 +1627,19 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $deliveryreceipt = $_POST['deliveryreceipt']; - if ($action == 'send') { + if ($action == 'send' || $action == 'relance') + { if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; else $subject = $langs->transnoentities('Bill') . ' ' . $object->ref; $actiontypecode = 'AC_FAC'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; - } - // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - } - if ($action == 'relance') { - if (dol_strlen($_POST['subject'])) - $subject = $_POST['subject']; - else - $subject = $langs->transnoentities('Relance facture ' . $object->ref); - $actiontypecode = 'AC_FAC'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto . ".\n"; - if ($message) { - $actionmsg .= $langs->transnoentities('MailTopic') . ": " . $subject . "\n"; - $actionmsg .= $langs->transnoentities('TextUsedInTheMessageBody') . ":\n"; - $actionmsg .= $message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } @@ -1661,9 +1649,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $formmail = new FormMail($db); $attachedfiles = $formmail->get_attached_files(); - $filepath = $attachedfiles ['paths']; - $filename = $attachedfiles ['names']; - $mimetype = $attachedfiles ['mimes']; + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index ea0d896f5d1..320d86f3377 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -136,12 +136,13 @@ if ($action == 'presend' && GETPOST('sendmail')) $message=make_substitutions($message, $substitutionarray); $actiontypecode='AC_FAC'; - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } // Create form object diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 337cf59c9b0..625376ace58 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -126,13 +126,14 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if ($action == 'send' || $action == 'relance') { if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; - $actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg2=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + $actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 407893021ef..199c342020d 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -31,7 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class Interfaces { - var $dir; // Directory with all core and external triggers files + var $db; + var $dir; // Directory with all core and external triggers files var $errors = array(); // Array for errors /** diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index 1fd29359d74..0682bb76a71 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -83,7 +83,8 @@ abstract class DolibarrTriggers $this->db = $db; - if (!isset($this->name)) { + if (empty($this->name)) + { $this->name = preg_replace('/^Interface/i', '', get_class($this)); } } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 632acf71b0e..d4fe47c0faa 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -222,7 +222,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("InvoiceSentByEMail",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; } - + // Parameters $object->sendtoid defined by caller //$object->sendtoid=0; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 7db0ecc56b1..8984e4c5424 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -462,12 +462,13 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile' if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha'); else $subject = $langs->transnoentities('Shipping').' '.$object->ref; $actiontypecode='AC_SHIP'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b5e874d03a6..77c7e17ffb5 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -745,12 +745,13 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA if (strlen(GETPOST('subject','alphs'))) $subject = GETPOST('subject','alpha'); else $subject = $langs->transnoentities('Intervention').' '.$object->ref; $actiontypecode='AC_OTH_AUTO'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4ae8fb17754..0273dea94b9 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -944,12 +944,13 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if (dol_strlen(GETPOST('subject'))) $subject=GETPOST('subject'); else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; $actiontypecode='AC_SUP_ORD'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e88b5a37945..b88fd582400 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -903,12 +903,13 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P if (dol_strlen($_POST['subject'])) $subject=$_POST['subject']; else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; $actiontypecode='AC_SUP_INV'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; if ($message) { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; + if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); } $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } From 6109529c6c6c88e6e84f98d3a4a54ecf33ee6158 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 14:19:28 +0100 Subject: [PATCH 095/171] vat payments list & typo on css class --- htdocs/compta/paiement/cheque/list.php | 4 +-- htdocs/compta/salaries/index.php | 2 +- htdocs/compta/sociales/index.php | 4 +-- htdocs/compta/tva/reglement.php | 41 ++++++++++++++++---------- htdocs/fourn/facture/paiement.php | 6 ++-- 5 files changed, 34 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 63923d6a3ce..47a6ee8ba74 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -130,7 +130,7 @@ if ($resql) // Lignes des champs de filtre print '
    '; print ''; print ''; print ''; print ''; print ''; // Ref print ''; print ''; // Label diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index b280fbdc2c2..00ef402fa36 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -170,7 +170,7 @@ if ($resql) print ''; // Ref print ''; // Label print ''; @@ -182,7 +182,7 @@ if ($resql) print ''; // Amount print ''; print ''; print ''; // Date start - print ''; - print ''; print ''; // Date end - print ''; // Location - print ''; + if (empty($conf->global->AGENDA_DISABLE_LOCATION)) + { + print ''; + } // Assigned to - print ''; + else + { + if (!empty($_SESSION['assignedtouser'])) + { + $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); + } + } + print $form->select_dolusers_forevent('view','assignedtouser',1); + if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody + print ' '; print '
     '; + print ''; + print ''; $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,16,0); print '   '; - print ''; + print ''; print '
     '; + print ''; + print "
    '; + print ''; + print '   '; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print ''; - print ''; - print '
    '; + print ''; + print "
    '; - print ' '; - print ''; - print "
    '.$langs->trans("VirtualStock").'".$product->stock_theorique; + if ($product->stock_theorique < $product->seuil_stock_alerte) { + print ' '.img_warning($langs->trans("StockLowerThanLimit")); + } + print '
    '.$langs->trans("VirtualStock").'".$product->stock_theorique; - if ($product->stock_theorique < $product->seuil_stock_alerte) - { - print ' '.img_warning($langs->trans("StockLowerThanLimit")); - } - print '
    '; + $text_stock_options = (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)?$langs->trans("DeStockOnShipment").'
    ':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'
    ':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'
    ':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)?$langs->trans("ReStockOnBill").'
    ':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'
    ':''); + $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'
    ':''); + print $form->textwithtooltip($langs->trans("StockDiffPhysicTeoric"),$text_stock_options,2,1,img_picto('', 'info'),'',0);; + print '
    '; - print '
    '; - if ($product->stock_theorique != $product->stock_reel) print $langs->trans("StockDiffPhysicTeoric"); - else print $langs->trans("RunningOrders"); - print ''; + $found=0; - $found=0; + // Number of customer orders running + if (! empty($conf->commande->enabled)) + { + if ($found) print '
    '; else $found=1; + print $langs->trans("CustomersOrdersRunning").': '.$product->stats_commande['qty']; + $result=$product->load_stats_commande(0,'0'); + if ($result < 0) dol_print_error($db,$product->error); + print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')'; + } - // Nbre de commande clients en cours - if (! empty($conf->commande->enabled)) - { - if ($found) print '
    '; else $found=1; - print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_sendings['qty']); - $result=$product->load_stats_commande(0,'0'); - if ($result < 0) dol_print_error($db,$product->error); - print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')'; - //print '
    '; - //print $langs->trans("CustomersSendingRunning").': '.$stock_sending_client; - } + // Number of product from customer order already sent (partial shipping) + if (! empty($conf->expedition->enabled)) { + if ($found) print '
    '; else $found=1; + $result=$product->load_stats_sending(0,'2'); + print $langs->trans("SendingRunning").': '.$product->stats_expedition['qty']; + } - // Nbre de commande fournisseurs en cours - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
    '; else $found=1; - print $langs->trans("SuppliersOrdersRunning").': '.($product->stats_commande_fournisseur['qty']-$product->stats_reception['qty']); - $result=$product->load_stats_commande_fournisseur(0,'0,1,2'); - if ($result < 0) dol_print_error($db,$product->error); - print ' ('.$langs->trans("DraftOrWaitingApproved").': '.$product->stats_commande_fournisseur['qty'].')'; - } - print '
     
    '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -239,10 +255,10 @@ if ($resql) print ' '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; $liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed")); print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1); - print ''; + print ''; + print ''; + print ''; print '
     
    '.price($total).''.price($total_ttc).'  
      '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; - print '
    '; print ''; - print ''; - print '
    '; - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; @@ -142,7 +142,7 @@ if ($resql) print ' '; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 8382029aa56..17c3efdbfaa 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -134,7 +134,7 @@ if ($result) print '
    '; - print ''; + print ''; print ' 
    '; - print ''; + print ''; print ' '; - print ''; + print ''; print ' '; diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 9bb4337782e..8babbd58f7d 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -35,6 +35,9 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -63,6 +66,14 @@ else $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; +} + /* * View */ @@ -76,8 +87,9 @@ $sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.fk_typepayment as ty $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; $sql.= " WHERE t.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND t.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; -if (GETPOST("search_amount")) $sql.=" AND t.amount = ".price2num(GETPOST("search_amount")); +if ($search_ref) $sql.=" AND t.rowid=".$search_ref; +if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; @@ -106,27 +118,26 @@ if ($result) print ''; print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre(""); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre(""); print "\n"; print ''; - print ''; - print ''; + print ''; + print ''; print ''; // Type print ''; - print ''; - print ''; - print "\n"; + print ''; + print '\n"; while ($i < min($num,$limit)) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 33691cb7942..3c94003ee4a 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -543,11 +543,11 @@ if (empty($action)) // Lines for filters fields print ''; print ''; print ''; print ''; print ''; print ''; From ff68c685c0d9f5620d2a27b312052b1dec30de73 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 14:41:19 +0100 Subject: [PATCH 096/171] Customers payments list --- htdocs/compta/paiement/list.php | 49 +++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index da1f2bd2833..65615b9bbf3 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -42,6 +42,11 @@ $paymentstatic=new Paiement($db); $accountstatic=new Account($db); $companystatic=new Societe($db); +$search_ref=GETPOST("search_ref","int"); +$search_account=GETPOST("search_account","int"); +$search_paymenttype=GETPOST("search_paymenttype"); +$search_amount=GETPOST("search_amount"); +$search_company=GETPOST("search_company"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -53,8 +58,14 @@ $limit = $conf->liste_limit; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; - - +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_account=""; + $search_amount=""; + $search_paymenttype=""; + $search_company=""; +} /* * View @@ -110,11 +121,11 @@ else else $sql.= " AND f.fk_user_author = ".$userid; } // Search criteria - if (GETPOST("search_ref")) $sql .=" AND p.rowid=".GETPOST("search_ref",'int'); - if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int'); - if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".GETPOST("search_paymenttype")."'"; - if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount")); - if (GETPOST("search_company")) $sql .= natural_search('s.nom', GETPOST('search_company')); + if ($search_ref) $sql .=" AND p.rowid=".$search_ref; + if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; + if ($search_paymenttype != "") $sql .=" AND c.code='".$search_paymenttype."'"; + if ($search_amount) $sql .=" AND p.amount='".price2num($search_amount)."'"; + if ($search_company) $sql .= natural_search('s.nom', $search_company); } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -129,9 +140,9 @@ if ($resql) $paramlist=''; $paramlist.=(GETPOST("orphelins")?"&orphelins=1":""); - $paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:""); - $paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:""); - $paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:""); + $paramlist.=($search_ref?"&search_ref=".$search_ref:""); + $paramlist.=($search_company?"&search_company=".$search_company:""); + $paramlist.=($search_amount?"&search_amount=".$search_amount:""); print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num); @@ -149,26 +160,29 @@ if ($resql) { print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); } - print "\n"; + print ''; + print "\n"; // Lines for filters fields print ''; print ''; print ''; print ''; print ''; print ''; print ''; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { @@ -223,7 +237,8 @@ if ($resql) if ($objp->statut == 0) print ''; print ''; } - + + print ''; print ''; $i++; From 1dcb7a58f3c5b5677f88784887c34d3f4d2827aa Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 14:51:21 +0100 Subject: [PATCH 097/171] Presentation & fix SQL injection --- htdocs/compta/sociales/index.php | 1 - htdocs/fourn/facture/paiement.php | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 00ef402fa36..db4bef2abe6 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -76,7 +76,6 @@ if (GETPOST("button_removefilter")) $typeid=""; $year=""; $month=""; - $filtre=""; } /* diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 3c94003ee4a..f467e9235ef 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -503,7 +503,7 @@ if (empty($action)) } if (! empty($search_amount)) { - $sql .= " AND p.amount=".price2num($search_amount); + $sql .= " AND p.amount='".price2num($search_amount)."'"; } if (! empty($search_company)) { @@ -524,7 +524,7 @@ if (empty($action)) $paramlist=''; $paramlist.=(! empty($search_ref)?"&search_ref=".$search_ref:""); $paramlist.=(! empty($search_company)?"&search_company=".$search_company:""); - $paramlist.=(! empty($search_amount)?"&search_amount=".$search_amount:""); + $paramlist.=(! empty($search_amount)?"&search_amount='".$search_amount:""); print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"],$paramlist,$sortfield,$sortorder,'',$num); @@ -538,7 +538,8 @@ if (empty($action)) print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder); - print "\n"; + print ''; + print "\n"; // Lines for filters fields print ''; @@ -557,7 +558,8 @@ if (empty($action)) print ''; print ''; print "\n"; @@ -594,7 +596,8 @@ if (empty($action)) print '';*/ - + + print ''; print ''; $i++; } From bebf0395999b4b5f3eb37402c38e33f7d2aa2117 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 15:05:20 +0100 Subject: [PATCH 098/171] Prospects list --- htdocs/comm/prospect/list.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 94286ee4c53..113618ffae8 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -48,7 +48,6 @@ $search_state = GETPOST("search_state"); $search_datec = GETPOST("search_datec"); $search_categ = GETPOST("search_categ",'int'); $search_status = GETPOST("search_status",'int'); -if ($search_status=='') $search_status=1; // always display activ customer first $catid = GETPOST("catid",'int'); $sortfield = GETPOST("sortfield",'alpha'); @@ -154,6 +153,21 @@ $sts = array(-1,0,1,2,3); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('prospectlist')); +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $socname=""; + $stcomm=""; + $search_nom=""; + $search_zipcode=""; + $search_town=""; + $search_state=""; + $search_datec=""; + $search_categ=""; + $search_status=""; +} + +if ($search_status=='') $search_status=1; // always display active customer first /* * Actions @@ -361,7 +375,7 @@ if ($resql) // Print these two select print $langs->trans("From").' '; print ' '; - print $langs->trans("To").' '; + print $langs->trans("to").' '; print ''; @@ -378,9 +392,9 @@ if ($resql) print ''; // Print the search button - print ''; + print '\n"; $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook From 85f0462c2028d0428bf376127c43623d9274d7f6 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 15:16:49 +0100 Subject: [PATCH 099/171] Suppliers list --- htdocs/fourn/list.php | 57 +++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php index d3f7e55c199..296415c1aee 100644 --- a/htdocs/fourn/list.php +++ b/htdocs/fourn/list.php @@ -32,15 +32,15 @@ $langs->load("suppliers"); $langs->load("orders"); $langs->load("companies"); -$socname = GETPOST("socname"); -$search_nom = GETPOST("search_nom"); -$search_zipcode = GETPOST("search_zipcode"); -$search_town = GETPOST("search_town"); -$search_code_fournisseur = GETPOST("search_code_fournisseur"); -$search_compta_fournisseur = GETPOST("search_compta_fournisseur"); -$search_datec = GETPOST("search_datec"); -$search_categ = GETPOST('search_categ','int'); -$catid = GETPOST("catid",'int'); +$socname = GETPOST("socname"); +$search_name = GETPOST("search_name"); +$search_zipcode = GETPOST("search_zipcode"); +$search_town = GETPOST("search_town"); +$search_supplier_code = GETPOST("search_supplier_code"); +$search_supplier_accounting = GETPOST("search_supplier_accounting"); +$search_datec = GETPOST("search_datec"); +$search_categ = GETPOST('search_categ','int'); +$catid = GETPOST("catid",'int'); // Security check $socid = GETPOST('socid','int'); @@ -60,6 +60,19 @@ if (! $sortfield) $sortfield="nom"; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('supplierlist')); +if (GETPOST("button_removefilter_x")) +{ + $socname=""; + $search_name=""; + $search_zipcode=""; + $search_town=""; + $search_supplier_code=""; + $search_supplier_accounting=""; + $search_datec=""; + $search_categ=""; + $catid=""; +} + /* * Actions */ @@ -95,15 +108,15 @@ if ($socname) { $sortfield = "s.nom"; $sortorder = "ASC"; } -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_name) { + $sql .= natural_search('s.nom', $search_name); } if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; if ($search_town) { $sql .= natural_search('s.town', $search_town); } -if ($search_code_fournisseur) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_code_fournisseur)."%'"; -if ($search_compta_fournisseur) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_compta_fournisseur)."%'"; +if ($search_supplier_code) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_supplier_code)."%'"; +if ($search_supplier_accounting) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_supplier_accounting)."%'"; if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; if ($catid > 0) $sql.= " AND cf.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cf.fk_categorie IS NULL"; @@ -126,7 +139,7 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_zipcode=".$search_zipcode."&search_town=".$search_town; + $param = "&search_name=".$search_name."&search_supplier_code=".$search_supplier_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; if ($search_categ != '') $param.='&search_categ='.$search_categ; print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); @@ -166,26 +179,28 @@ if ($resql) print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; - + print '\n"; + $parameters=array(); $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook From df5d34266c933a8f9d1cb81b76bfcb13421ad19e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 15:26:20 +0100 Subject: [PATCH 100/171] Lost button --- htdocs/comm/propal/list.php | 7 +++++-- htdocs/contact/list.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6522a592097..2b8e478d37d 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -322,8 +322,11 @@ if ($result) print ''; - print ''; + print ''; print "\n"; $var=true; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c65e9601e53..a311c87cffc 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -357,7 +357,7 @@ if ($result) print ''; print ''; print ''; From 2b8abf27941312a193b107f1468abd7e2223afc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 20:07:38 +0100 Subject: [PATCH 101/171] Fix: Missing label --- htdocs/core/boxes/box_actions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 7d118932ba4..738582ad931 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -63,7 +63,7 @@ class box_actions extends ModeleBoxes if ($user->rights->agenda->myactions->read) { $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; - $sql.= " ta.code,"; + $sql.= " ta.code, ta.libelle as type_label,"; $sql.= " s.nom as name, s.rowid as socid"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; @@ -96,7 +96,7 @@ class box_actions extends ModeleBoxes if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late")); //($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label) - $label=$objp->label; + $label=empty($objp->label)?$objp->type_label:$objp->label; $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ("action"), From 10ed271e38efe8360438d4a7ecb54aad2a141d34 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 20:18:46 +0100 Subject: [PATCH 102/171] Search bank transactions --- htdocs/compta/bank/search.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 25b7d91a3ff..1e8196481e6 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("companies"); +$langs->load("margins"); // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -72,6 +73,15 @@ $limit = $conf->liste_limit; if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='b.dateo'; +if (GETPOST("button_removefilter")) +{ + $description=""; + $type=""; + $debit=""; + $credit=""; + $account=""; + $bid=""; +} /* * View @@ -198,7 +208,7 @@ if ($resql) print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; + print ''; + print "\n"; // Loop on each record $total_debit=0; From 5bf5b9b16f2fd59d34c3e0c37ec2693395bd6f29 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 21:12:40 +0100 Subject: [PATCH 103/171] Trips list --- htdocs/compta/deplacement/list.php | 71 +++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index bb2c50b42bf..da0e3e21dcd 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -27,6 +27,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->load("companies"); $langs->load("users"); @@ -37,6 +39,10 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'deplacement','',''); +$search_ref=GETPOST('search_ref','int'); +$search_name=GETPOST('search_name','alpha'); +$search_company=GETPOST('search_company','alpha'); +// $search_amount=GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -48,13 +54,24 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.dated"; $limit = $conf->liste_limit; -$search_ref=GETPOST('search_ref','alpha'); +$year=GETPOST("year"); +$month=GETPOST("month"); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_name=""; + $search_company=""; + // $search_amount=""; + $year=""; + $month=""; +} /* * View */ +$formother = new FormOther($db); $tripandexpense_static=new Deplacement($db); $userstatic = new User($db); @@ -76,10 +93,31 @@ $sql.= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')'; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; -if (trim($search_ref) != '') + +if ($search_ref) $sql.=" AND d.rowid=".$search_ref; +if ($search_name) { - $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; + $sql .= natural_search('u.lastname', $search_name); } +if ($search_company) +{ + $sql .= natural_search('s.nom', $search_company); +} +// if ($search_amount) $sql.=" AND d.km='".$db->escape(price2num(trim($search_amount)))."'"; +if ($month > 0) +{ + if ($year > 0 && empty($day)) + $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND d.dated BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(d.dated, '%m') = '".$month."'"; +} +else if ($year > 0) +{ + $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; +} + $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -97,7 +135,7 @@ if ($resql) print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder); @@ -107,24 +145,27 @@ if ($resql) // Filters lines print ''; print ''; print ''; + print ''; print ''; - print ''; print ''; - print ''; print '\n"; $var=true; @@ -142,9 +183,9 @@ if ($resql) // Type print ''; // Date - print ''; + print ''; // User - print ''; print "\n"; @@ -323,7 +334,8 @@ print ''; // ACTION print ''; print "\n"; From 39e83576a223efdcba485c410588b90e1f001e98 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 21:44:03 +0100 Subject: [PATCH 109/171] prelevement list --- htdocs/compta/prelevement/list.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 10fb995c023..0a68aa686ae 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -42,10 +42,10 @@ $result = restrictedArea($user, 'prelevement','','','bons'); $page = GETPOST('page','int'); $sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); $sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); -$search_line = GETPOST('search_ligne','alpha'); +$search_line = GETPOST('search_line','alpha'); $search_bon = GETPOST('search_bon','alpha'); $search_code = GETPOST('search_code','alpha'); -$search_societe = GETPOST('search_societe','alpha'); +$search_company = GETPOST('search_company','alpha'); $statut = GETPOST('statut','int'); $bon=new BonPrelevement($db,""); @@ -53,7 +53,14 @@ $ligne=new LignePrelevement($db,$user); $offset = $conf->liste_limit * $page ; - +if (GETPOST("button_removefilter")) +{ + $search_line=""; + $search_bon=""; + $search_code=""; + $search_company=""; + $statut=""; +} /* * View @@ -88,9 +95,9 @@ if ($search_code) { $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; } -if ($search_societe) +if ($search_company) { - $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; + $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } $sql.=$db->order($sortfield,$sortorder); $sql.=$db->plimit($conf->liste_limit+1, $offset); @@ -122,15 +129,17 @@ if ($result) print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; - print ''; - print ''; + print ''; print ''; $var=True; From a1980a1917bb8a4117f2aa6d0206f1e4cbd99d4a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 22:04:01 +0100 Subject: [PATCH 110/171] Correct travis error - Not me ! --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 2d5bf7ab0cd..4b9401498d7 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -766,7 +766,7 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0) * @param int $inhour 0: return number of days, 1: return number of hours * @param int $lastday We include last day, 0: no, 1:yes * @param int $halfday Tag to define half day when holiday start and end - * @param string $countrycode Country code (company country code if not defined) + * @param string $country_code Country code (company country code if not defined) * @return int Number of days or hours */ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='') From ddf737daed9e5ea7d5ab6223570be68e089044c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 01:07:07 +0100 Subject: [PATCH 111/171] Removed deprecated page and option. --- htdocs/comm/action/card.php | 8 +- htdocs/comm/action/contact.php | 258 -------------------------------- htdocs/comm/action/document.php | 163 +++++++++++++------- htdocs/core/lib/agenda.lib.php | 8 - 4 files changed, 114 insertions(+), 323 deletions(-) delete mode 100644 htdocs/comm/action/contact.php diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 607f8e14c4e..a1e6f89f663 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -790,11 +790,11 @@ if ($id > 0) { $result1=$object->fetch($id); $result2=$object->fetch_thirdparty(); - $result2=$object->fetch_contact(); - $result3=$object->fetch_userassigned(); - $result4=$object->fetch_optionals($id,$extralabels); + $result3=$object->fetch_contact(); + $result4=$object->fetch_userassigned(); + $result5=$object->fetch_optionals($id,$extralabels); - if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0) + if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) { dol_print_error($db,$object->error); exit; diff --git a/htdocs/comm/action/contact.php b/htdocs/comm/action/contact.php deleted file mode 100644 index 334da53a2f4..00000000000 --- a/htdocs/comm/action/contact.php +++ /dev/null @@ -1,258 +0,0 @@ - - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2012 Philippe Grand - * - * 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 . - */ - -/** - * \file htdocs/comm/action/contact.php - * \ingroup agenda - * \brief Page for multi-users event - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - -$langs->load("companies"); -$langs->load("commercial"); -$langs->load("other"); -$langs->load("bills"); - -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); -$ref = GETPOST('ref'); -$confirm = GETPOST('confirm'); -$lineid = GETPOST('lineid','int'); - -// Security check -$socid = GETPOST('socid','int'); -if ($user->societe_id) $socid=$user->societe_id; -if ($user->societe_id > 0) -{ - unset($_GET["action"]); - $action=''; -} -$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); - - -$object = new ActionComm($db); - - -/* - * Actions - */ - -// Add new contact -if ($action == 'addcontact' && $user->rights->action->creer) -{ - $result = $object->fetch($id); - - if ($object->id > 0) - { - $contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} - -// modification d'un contact. On enregistre le type -if ($action == 'updateline') -{ - if ($object->fetch($id)) - { - $contact = $object->detail_contact($_POST["line"]); - $type = $_POST["type"]; - $statut = $contact->statut; - - $result = $object->update_contact($_POST["line"], $statut, $type); - if ($result >= 0) - { - $db->commit(); - } else - { - dol_print_error($db, "result=$result"); - $db->rollback(); - } - } - else - { - setEventMessage($object->error, 'errors'); - } -} - -// Bascule du statut d'un contact -else if ($action == 'swapstatut') -{ - if ($object->id > 0) - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } -} - -// Efface un contact -else if ($action == 'deletecontact') -{ - $result = $object->delete_contact($lineid); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); - } -} - -/* - * View - */ - -$form = new Form($db); -$formcompany= new FormCompany($db); - -$contactstatic=new Contact($db); -$userstatic=new User($db); - -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; -llxHeader('',$langs->trans("Agenda"),$help_url); - - -if ($id > 0 || ! empty($ref)) -{ - if ($object->fetch($id,$ref) > 0) - { - - $head=actions_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("Action"),0,'action'); - - // Affichage fiche action en mode visu - print '
      '; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print ''; - print ''; - print '
    '; + print ''; + print "
    '; - print ''; + print ''; print ' '; - print ''; + print ''; print ''; $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); @@ -556,7 +556,7 @@ if (empty($action)) $form->select_comptes($search_account,'search_account',0,'',1); print ''; - print ''; + print ''; print ''; print ''; print '
     
    '; - print ''; + print ''; print ' '; - print ''; + print ''; print ''; - $form->select_types_paiements($_REQUEST["search_paymenttype"],'search_paymenttype','',2,1,1); + $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); print ''; - $form->select_comptes($_REQUEST["search_account"],'search_account',0,'',1); + $form->select_comptes($search_account,'search_account',0,'',1); print ''; - print ''; + print ''; + print ''; print ''; + print ''; print ' 
     
    '; print ''; - print ''; + print ''; + print ''; print ''; print '
    '; print $invoicesupplierstatic->getNomUrl(1); print ' 
    '; - print ''; - print ''; + print ''; + print "
    '; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; + print ''; + print "
    '; $formpropal->selectProposalStatus($viewstatut,1); print ''; - print ''; + print ''; + print ' '; + print ''; + print '
    '; print ''; - print '  '; + print ' '; print ''; print '
      '; - $form->select_types_paiements(empty($_REQUEST["type"])?'':$_REQUEST["type"], 'type', '', 2, 0, 1, 8); + $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8); print ''; @@ -214,9 +224,9 @@ if ($resql) print ''; print ''; if (! empty($_REQUEST['bid'])) print ''; - print ''; - print '
    '; - print ''; + print ''; print ''; - //print ''; + print ' '; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; - //print ''; + print ''; print ''; - print ' '; + print ''; + print ''; print ''; - print ' '; - print ''; - print ' '; + // print ''; print ''; + print ''; print "
    '.$langs->trans($obj->type).''.dol_print_date($db->jdate($obj->dd),'day').''.dol_print_date($db->jdate($obj->dd),'day').''; + print ''; $userstatic->id = $obj->rowid; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; From 5a18904bb48f19d792c7eb1afbde8c33efafb4a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 21:16:31 +0100 Subject: [PATCH 104/171] Fix: Infinite loop --- htdocs/core/lib/date.lib.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index a95bbec6b72..2d5bf7ab0cd 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -566,9 +566,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $nbFerie = 0; // Check to ensure we use correct parameters - if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hour and be GMT dates'; + if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; - while ($timestampStart < $timestampEnd) // Loop end when equals + $i=0; + while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) { $ferie=false; $countryfound=0; @@ -576,7 +577,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); - if ($countrycode == 'FR') { $countryfound=1; @@ -722,8 +722,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') if ($ferie) $nbFerie++; // Increase number of days (on go up into loop) - $jour++; - $timestampStart=dol_mktime(0,0,0,$mois,$jour,$annee,1); // Generate GMT date for next day + $timestampStart=dol_time_plus_duree($timestampStart, 1, 'd'); + //var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart); + + $i++; } return $nbFerie; @@ -764,13 +766,16 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0) * @param int $inhour 0: return number of days, 1: return number of hours * @param int $lastday We include last day, 0: no, 1:yes * @param int $halfday Tag to define half day when holiday start and end + * @param string $countrycode Country code (company country code if not defined) * @return int Number of days or hours */ -function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0) +function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='') { - global $langs; + global $langs,$mysoc; - dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday); + if (empty($country_code)) $country_code=$mysoc->country_code; + + dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday.' country_code='.$country_code); // Check parameters if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day'; @@ -779,7 +784,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday; if ($timestampStart < $timestampEnd) { - $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $lastday); + $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code); + $nbOpenDay = $numdays - $numholidays; $nbOpenDay.= " " . $langs->trans("Days"); if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); From 1f4f2291f610585b3958fc9f8e7070f65990b976 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 21:18:16 +0100 Subject: [PATCH 105/171] Start module with status experimental --- htdocs/core/modules/modSyncSupplierWebServices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSyncSupplierWebServices.class.php b/htdocs/core/modules/modSyncSupplierWebServices.class.php index 088989f9de4..c17892ee217 100755 --- a/htdocs/core/modules/modSyncSupplierWebServices.class.php +++ b/htdocs/core/modules/modSyncSupplierWebServices.class.php @@ -44,7 +44,7 @@ class modSyncSupplierWebServices extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the client for external supplier web services"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) From 627f5694f0a71b0b7fdb6a82188d732c54d029b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 21:16:31 +0100 Subject: [PATCH 106/171] Fix: Infinite loop --- htdocs/core/lib/date.lib.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 48ccec88cf1..6a5024c1c80 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -563,9 +563,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $nbFerie = 0; // Check to ensure we use correct parameters - if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hour and be GMT dates'; + if ((($timestampEnd - $timestampStart) % 86400) != 0) return 'ErrorDates must use same hours and must be GMT dates'; - while ($timestampStart < $timestampEnd) // Loop end when equals + $i=0; + while ($timestampStart < $timestampEnd && ($i < 50000)) // Loop end when equals (Test on i is a security loop to avoid infinite loop) { $ferie=false; $countryfound=0; @@ -573,7 +574,6 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') $jour = date("d", $timestampStart); $mois = date("m", $timestampStart); $annee = date("Y", $timestampStart); - if ($countrycode == 'FR') { $countryfound=1; @@ -676,8 +676,10 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') if ($ferie) $nbFerie++; // Increase number of days (on go up into loop) - $jour++; - $timestampStart=dol_mktime(0,0,0,$mois,$jour,$annee,1); // Generate GMT date for next day + $timestampStart=dol_time_plus_duree($timestampStart, 1, 'd'); + //var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart); + + $i++; } return $nbFerie; @@ -718,13 +720,16 @@ function num_between_day($timestampStart, $timestampEnd, $lastday=0) * @param int $inhour 0: return number of days, 1: return number of hours * @param int $lastday We include last day, 0: no, 1:yes * @param int $halfday Tag to define half day when holiday start and end + * @param string $countrycode Country code (company country code if not defined) * @return int Number of days or hours */ -function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0) +function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='') { - global $langs; + global $langs,$mysoc; - dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday); + if (empty($country_code)) $country_code=$mysoc->country_code; + + dol_syslog('num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday.' country_code='.$country_code); // Check parameters if (! is_int($timestampStart) && ! is_float($timestampStart)) return 'ErrorBadParameter_num_open_day'; @@ -733,7 +738,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha //print 'num_open_day timestampStart='.$timestampStart.' timestampEnd='.$timestampEnd.' bit='.$lastday; if ($timestampStart < $timestampEnd) { - $nbOpenDay = num_between_day($timestampStart, $timestampEnd, $lastday) - num_public_holiday($timestampStart, $timestampEnd, $lastday); + $numdays = num_between_day($timestampStart, $timestampEnd, $lastday); + $numholidays = num_public_holiday($timestampStart, $timestampEnd, $country_code); + $nbOpenDay = $numdays - $numholidays; $nbOpenDay.= " " . $langs->trans("Days"); if ($inhour == 1 && $nbOpenDay <= 3) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); From ca69bf9d7eb7b611bc09f8b32faaf69531df4edb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 21:20:24 +0100 Subject: [PATCH 107/171] Fix: Infinite loop --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 28d86310494..25d8c7d638d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ English Dolibarr ChangeLog - Fix: Civility & birthdate wasn't save into adherent module. - Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref - Fix: Chars - is no more allowed into value for code for extra fields. +( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: From 5b2318030387262c530c3cc5e55f047853bda2f7 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 2 Nov 2014 21:28:02 +0100 Subject: [PATCH 108/171] Holiday list --- htdocs/holiday/index.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 04a96a7001d..e988e640711 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -64,6 +64,19 @@ $search_employe = GETPOST('search_employe'); $search_valideur = GETPOST('search_valideur'); $search_statut = GETPOST('select_statut'); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $month_create=""; + $year_create=""; + $month_start=""; + $year_start=""; + $month_end=""; + $year_end=""; + $search_employe=""; + $search_valideur=""; + $search_statut=""; +} /* * Actions @@ -71,8 +84,6 @@ $search_statut = GETPOST('select_statut'); // None - - /* * View */ @@ -257,7 +268,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"),$_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); print '
    '; -print ''; +print ''; +print ''; print '
       
    '; + print ''; + print ''; + print '
    '; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - { - print ''; - } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Location - print ''; - - print '
    '.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '
    '.$langs->trans("Type").''.$object->type.'
    '.$langs->trans("Title").''.$object->label.'
    '.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent).'
    '.$langs->trans("DateActionStart").''; - if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); - else print dol_print_date($object->datep,'day'); - if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
    '."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
    '."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
    '."\n"; - print '
    '.$langs->trans("DateActionEnd").''; - if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); - else print dol_print_date($object->datef,'day'); - if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
    '.$langs->trans("Location").''.$object->location.'
    '; - - dol_fiche_end(); - - print '
    '; - - // Contacts lines (modules that overwrite templates must declare this into descriptor) - $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); - foreach($dirtpls as $reldir) - { - $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); - if ($res) break; - } - - } - else - { - print "ErrorRecordNotFound"; - } -} - -llxFooter(); - -$db->close(); - diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 5e180f66abb..9bb3af6dcbd 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -41,7 +41,7 @@ $langs->load("commercial"); $langs->load("other"); $langs->load("bills"); -$objectid = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $action=GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); @@ -53,13 +53,13 @@ if ($user->societe_id > 0) unset($_GET["action"]); $action=''; } -$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); +$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id'); $object = new ActionComm($db); -if ($objectid > 0) +if ($id > 0) { - $ret = $object->fetch($objectid); + $ret = $object->fetch($id); $object->fetch_thirdparty(); } @@ -96,11 +96,25 @@ llxHeader('',$langs->trans("Agenda"),$help_url); if ($object->id > 0) { + $result1=$object->fetch($id); + $result2=$object->fetch_thirdparty(); + $result3=$object->fetch_contact(); + $result4=$object->fetch_userassigned(); + $result5=$object->fetch_optionals($id,$extralabels); + + if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) + { + dol_print_error($db,$object->error); + exit; + } + + if ($object->authorid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->authorid); $object->author=$tmpuser; } + if ($object->usermodid > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermodid); $object->usermod=$tmpuser; } + $author=new User($db); $author->fetch($object->author->id); $object->author=$author; - $object->fetch_contact(); $head=actions_prepare_head($object); @@ -132,53 +146,15 @@ if ($object->id > 0) print '
    '.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent).'
    '.$langs->trans("DateActionStart").''; + print '
    '.$langs->trans("DateActionStart").''; if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour'); else print dol_print_date($object->datep,'day'); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print ''."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; - print '
    '."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; - print '
    '."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; - print '
    '."\n"; - print '
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; - print '
    '."\n"; - print '
    '.$langs->trans("DateActionEnd").''; + print '
    '.$langs->trans("DateActionEnd").''; if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour'); else print dol_print_date($object->datef,'day'); if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); @@ -190,16 +166,38 @@ if ($object->id > 0) print '
    '.$langs->trans("Location").''.$object->location.'
    '.$langs->trans("Location").''.$object->location.'
    '.$langs->trans("ActionAffectedTo").''; - if ($object->userownerid > 0) + print '
    '.$langs->trans("ActionAffectedTo").''; + $listofuserid=array(); + if (empty($donotclearsession)) { - $tmpuser=new User($object->userownerid); - print $tmpuser->getNomUrl(1); + if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first + if (! empty($object->userassigned)) // Now concat assigned users + { + // Restore array with key with same value than param 'id' + $tmplist1=$object->userassigned; $tmplist2=array(); + foreach($tmplist1 as $key => $val) + { + if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val; + } + } + $_SESSION['assignedtouser']=dol_json_encode($listofuserid); } - print '


    '; @@ -252,8 +250,20 @@ if ($object->id > 0) print ($object->priority?$object->priority:''); print ''; + // Other attributes + $parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$object->id); + $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)) + { + print $object->showOptionals($extrafields,'edit'); + } - print '


    '; + + print '
    '; + + print '

    '; + + print ''; // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); @@ -266,7 +276,8 @@ if ($object->id > 0) print ''; print ''; - print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + print ''; print ''; @@ -274,6 +285,52 @@ if ($object->id > 0) $permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; + + + if ($action != 'edit') + { + print "
    "; + + // Link to agenda views + print '
    '; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; + print '
    '."\n"; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; + print '
    '."\n"; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; + print '
    '."\n"; + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; + print '
    '."\n"; + print '
    '; + } } else { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3d9a5e8299c..d2270cb5584 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -440,14 +440,6 @@ function actions_prepare_head($object) $head[$h][2] = 'card'; $h++; - if (! empty($conf->global->AGENDA_USE_SEVERAL_CONTACTS)) - { - $head[$h][0] = DOL_URL_ROOT.'/comm/action/contact.php?id='.$object->id; - $head[$h][1] = $langs->trans("Contacts"); - $head[$h][2] = 'contact'; - $h++; - } - // Attached files require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->agenda->dir_output . "/" . $object->id; From 3ee4cfe30bddeb0f57814ea35516e4054b1f448f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 3 Nov 2014 05:57:09 +0100 Subject: [PATCH 112/171] Intervention card list --- htdocs/fichinter/list.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 076ad9bc689..28dad4bbb89 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -61,6 +61,13 @@ $search_company=GETPOST('search_company','alpha'); $search_desc=GETPOST('search_desc','alpha'); $search_status=GETPOST('search_status'); +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_company=""; + $search_desc=""; + $search_status=""; +} /* * View @@ -125,6 +132,7 @@ if ($result) print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('',$_SERVER["PHP_SELF"], ''); print "\n"; print ''; @@ -145,9 +153,10 @@ if ($result) print ''; $liststatus=$interventionstatic->statuts_short; print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1); - print ''; print ''; - print "\n"; + print ''; + print ''; + print "\n"; $companystatic=new Societe($db); @@ -178,7 +187,8 @@ if ($result) print ''.convertSecondToTime($objp->duree).''; } print ''.$interventionstatic->LibStatut($objp->fk_statut,5).''; - + + print ' '; print "\n"; $total += $objp->duree; @@ -188,10 +198,10 @@ if ($result) if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { print ''.$langs->trans("Total").''; - print ''.convertSecondToTime($total).' '; + print ''.convertSecondToTime($total).'  '; print ''; } - + print ''; print "\n"; $db->free($result); From 111b2e83f1e52f25eb34620330b541c226b4ef26 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 3 Nov 2014 06:05:51 +0100 Subject: [PATCH 113/171] Contracts list --- htdocs/contrat/list.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index dcc1b83e6d8..cf57e97933b 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -40,11 +40,11 @@ if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; -$search_nom=GETPOST('search_nom'); +$search_name=GETPOST('search_name'); $search_contract=GETPOST('search_contract'); $search_ref_supplier=GETPOST('search_ref_supplier','alpha'); $sall=GETPOST('sall'); -$statut=GETPOST('statut')?GETPOST('statut'):1; +$search_status=GETPOST('search_status'); $socid=GETPOST('socid'); if (! $sortfield) $sortfield="c.rowid"; @@ -58,6 +58,17 @@ $result = restrictedArea($user, 'contrat', $id); $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); +if (GETPOST("button_removefilter")) +{ + $search_name=""; + $search_contract=""; + $search_ref_supplier=""; + $sall=""; + $search_status=""; +} + +if ($search_status == '') $search_status=1; + /* * View @@ -84,8 +95,8 @@ $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND c.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_name) { + $sql .= natural_search('s.nom', $search_name); } if ($search_contract) { $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); @@ -106,13 +117,13 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_nom='.$search_nom, $sortfield, $sortorder,'',$num); + print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_name='.$search_name, $sortfield, $sortorder,'',$num); print ''; print ''; $param='&search_contract='.$search_contract; - $param.='&search_nom='.$search_nom; + $param.='&search_name='.$search_name; $param.='&search_ref_supplier='.$search_ref_supplier; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); @@ -136,13 +147,13 @@ if ($resql) print ''; print ''; print ''; print ''; //print ''; - print '"; - print "\n"; + print '\n"; print ''; $var=true; From 5dacf3c3cd9116de20c97ecdb278b9174d5fb1fe Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 3 Nov 2014 06:12:57 +0100 Subject: [PATCH 114/171] Contracts services list --- htdocs/contrat/services.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 77fc0155430..b0fb4ed5edb 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -44,7 +44,7 @@ if (! $sortfield) $sortfield="c.rowid"; if (! $sortorder) $sortorder="ASC"; $filter=GETPOST("filter"); -$search_nom=GETPOST("search_nom"); +$search_name=GETPOST("search_name"); $search_contract=GETPOST("search_contract"); $search_service=GETPOST("search_service"); $statut=GETPOST('statut')?GETPOST('statut'):1; @@ -69,6 +69,21 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); +if (GETPOST("button_removefilter")) +{ + $search_name=""; + $search_contract=""; + $search_service=""; + $op1month=""; + $op1day=""; + $op1year=""; + $filter_op1=""; + $op2month=""; + $op2day=""; + $op2year=""; + $filter_op2=""; +} + /* * View */ @@ -101,7 +116,7 @@ if ($mode == "0") $sql.= " AND cd.statut = 0"; if ($mode == "4") $sql.= " AND cd.statut = 4"; if ($mode == "5") $sql.= " AND cd.statut = 5"; if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'"; -if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; +if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'"; if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'"; if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; @@ -122,7 +137,7 @@ if ($resql) $param=''; if ($search_contract) $param.='&search_contract='.urlencode($search_contract); - if ($search_nom) $param.='&search_nom='.urlencode($search_nom); + if ($search_name) $param.='&search_name='.urlencode($search_name); if ($search_service) $param.='&search_service='.urlencode($search_service); if ($mode) $param.='&mode='.$mode; if ($filter) $param.='&filter='.$filter; @@ -168,7 +183,7 @@ if ($resql) print ''; // Third party print ''; print ''; - print '"; - print "\n"; + print '\n"; print ''; $contractstatic=new Contrat($db); From b2ed53b78563fd4d64c202b43d4ff2318f7c25f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 15:47:33 +0100 Subject: [PATCH 115/171] Fix: Switch company/individual --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 54effb54b20..d9c5e70283c 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -781,7 +781,7 @@ else print '
    '; print $langs->trans("ThirdPartyType").':     '; print '
    '; - print ''; + print ''; print '
    '; - print ''; + print ''; print '  '; - print "
    '; + print ''; + print "
    '; - print ''; + print ''; print ''; $arrayofoperators=array('<'=>'<','>'=>'>'); @@ -184,9 +199,9 @@ if ($resql) $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); print $form->select_date($filter_date2,'op2',0,0,1); print ''; - print "
    '; + print ''; + print "
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "
    '.$langs->trans("SearchAnIntervention").'
    :
    :
    \n"; + print "
    "; +} + /* * Draft proposals */ diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 076ad9bc689..4bea6c46850 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -56,10 +56,11 @@ if (! $sortfield) } $limit = $conf->liste_limit; -$search_ref=GETPOST('search_ref','alpha'); +$search_ref=GETPOST('search_ref')?GETPOST('search_ref','alpha'):GETPOST('search_inter','alpha'); $search_company=GETPOST('search_company','alpha'); $search_desc=GETPOST('search_desc','alpha'); $search_status=GETPOST('search_status'); +$sall=GETPOST('sall'); /* @@ -99,6 +100,11 @@ if (! $user->rights->societe->client->voir && empty($socid)) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = " . $socid; +if ($sall) { + $arraytosearch=array('f.ref', 'f.description', 's.nom'); + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $arraytosearch=array('f.ref', 'f.description', 's.nom', 'fd.description'); + $sql .= natural_search($arraytosearch, $sall); +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); //print $sql; diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 3e4011b0b79..c79da05364e 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -38,6 +38,7 @@ InterventionClassifiedBilledInDolibarr=Intervention %s set as billed InterventionClassifiedUnbilledInDolibarr=Intervention %s set as unbilled InterventionSentByEMail=Intervention %s sent by EMail InterventionDeletedInDolibarr=Intervention %s deleted +SearchAnIntervention=Search an intervention ##### Types de contacts ##### TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention TypeContact_fichinter_internal_INTERVENING=Intervening From 5074feacd68e1876deb9338da4f8a708dfe75a50 Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Mon, 3 Nov 2014 17:57:55 +0100 Subject: [PATCH 120/171] Add option and create new class --- htdocs/admin/security.php | 114 +++++++++++ .../generate/modGeneratePassPerso.class.php | 192 ++++++++++++++++++ htdocs/langs/fr_FR/admin.lang | 8 + 3 files changed, 314 insertions(+) create mode 100644 htdocs/core/modules/security/generate/modGeneratePassPerso.class.php diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 43ccef1e954..0101465e674 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -165,6 +165,16 @@ else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') exit; } +if ($action == 'maj_pattern') +{ + dolibarr_set_const($db, "USER_PASSWORD_PATTERN", GETPOST("pattern"),'chaine',0,'',$conf->entity); + header("Location: security.php"); + exit; +} + + + + @@ -265,6 +275,110 @@ foreach ($arrayhandler as $key => $module) print ''; print ''; +//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +// Patter for Password Perso +if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ +$var=!$var; + + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); + /*$this->length2 = $tabConf[0]; + $this->NbMaj = $tabConf[1]; + $this->NbNum = $tabConf[2]; + $this->NbSpe = $tabConf[3]; + $this->NbRepeat = $tabConf[4]; + $this->WithoutAmbi = $tabConf[5]; + */ + print ''; + print ''; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print '"; + print ''; + print ''; + + $var=!$var; + print ""; + print ''; + print ''; + print '
    '.$langs->trans("PasswordPatternDesc").'
    ' . $langs->trans("MinLength")."
    ' . $langs->trans("NbMajMin")."
    ' . $langs->trans("NbNumMin")."
    ' . $langs->trans("NbSpeMin")."
    ' . $langs->trans("NbIteConsecutive")."
    ' . $langs->trans("NoAmbiCaracAutoGeneration")."
    '.$langs->trans("Save").'
    '; + + print ''; +} + + // Cryptage mot de passe print '
    '; $var=true; diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php new file mode 100644 index 00000000000..b2eab5d1495 --- /dev/null +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -0,0 +1,192 @@ + + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/security/generate/modGeneratePassPerso.class.php + * \ingroup core + * \brief File to manage no password generation. + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpassword.php'; + + +/** + * \class modGeneratePassPerso + * \brief Class to generate a password according to personal rules + */ +class modGeneratePassPerso extends ModeleGenPassword +{ + var $id; + var $length; + var $length2; // didn't overright display + var $NbMaj; + var $NbNum; + var $NbSpe; + var $NbRepeat; + var $WithoutAmbi; + + var $db; + var $conf; + var $lang; + var $user; + + var $Maj; + var $Min; + var $Nb; + var $Spe; + var $Ambi; + var $All; + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param Conf $conf Handler de conf + * @param Translate $langs Handler de langue + * @param User $user Handler du user connecte + */ + function __construct($db, $conf, $langs, $user) + { + $this->id = "Perso"; + $this->length = $langs->trans("SetupPerso"); + + $this->db=$db; + $this->conf=$conf; + $this->langs=$langs; + $this->user=$user; + + if(empty($conf->global->USER_PASSWORD_PATTERN)){ + dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '8;1;1;1;8;0','chaine',0,'',$conf->entity); + } + + $this->Maj = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + //$this->Maj = "Y"; + $this->Min = strtolower($this->Maj); + $this->Nb = "0123456789"; + //$this->Nb = "X"; + $this->Spe = "!@#$%&*()_-+={}[]\\|:;'/"; + //$this->Spe = "<>;}?"; + $this->Ambi = array("1","I","l","|","O","0"); + + $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN); + $this->length2 = $tabConf[0]; + $this->NbMaj = $tabConf[1]; + $this->NbNum = $tabConf[2]; + $this->NbSpe = $tabConf[3]; + $this->NbRepeat = $tabConf[4]; + $this->WithoutAmbi = $tabConf[5]; + + if($this->WithoutAmbi){ + $this->Maj = str_replace($this->Ambi,"",$this->Maj ); + $this->Min = str_replace($this->Ambi,"",$this->Min ); + $this->Nb = str_replace($this->Ambi,"",$this->Nb ); + $this->Spe = str_replace($this->Ambi,"",$this->Spe ); + } + + $this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe); + //$this->All = $this->Maj. $this->Min. $this->Nb. $this->Spe; + //$this->All = $this->Spe; + + } + + /** + * Return description of module + * + * @return string Description of text + */ + function getDescription() + { + global $langs; + return $langs->trans("PasswordGenerationPerso"); + } + + /** + * Return an example of password generated by this module + * + * @return string Example of password + */ + function getExample() + { + return $this->getNewGeneratedPassword(); + } + + /** + * Build new password + * + * @return string Return a new generated password + */ + function getNewGeneratedPassword() + { + $pass = ""; + for($i=0; $i<$this->NbMaj; $i++){ // Y + $pass .= $this->Maj[rand(0,strlen($this->Maj) - 1)]; + } + + for($i=0; $i<$this->NbNum; $i++){ // X + $pass .= $this->Nb[rand(0,strlen($this->Nb) - 1)]; + } + + for($i=0; $i<$this->NbSpe; $i++){ // @ + $pass .= $this->Spe[rand(0,strlen($this->Spe) - 1)]; + } + + for($i=strlen($pass);$i<$this->length2; $i++){ // y + $pass .= $this->All[rand(0,strlen($this->All) -1)]; + } + return str_shuffle($pass) ; + } + + /** + * Validate a password + * + * @param string $password Password to check + * @return int 0 if KO, >0 if OK + */ + function validatePassword($password) + { + return 1; + } + + /** + * consecutive iterations of the same character + * + * @param string $password Password to check + * @return int 0 if KO, >0 if OK + */ + function consecutiveInterationSameCharacter($password){ + $last = ""; + $count = 0; + $char = explode("", $password); + + foreach($char as $c){ + if($c != $last){ + $last = $c; + $count = 0; + }else{ + $count++; + } + + if($count > $this->NbRepeat) { + return true; + } + } + return false; + } +} + diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 28edf08867b..53061a3e944 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -327,6 +327,12 @@ ModuleDisabled=Module désactivé ModuleDisabledSoNoEvent=Module désactivé donc événement jamais créé ConfirmPurge=Êtes-vous sûr de vouloir réaliser cette purge ?
    Ceci effacera définitivement tous vos fichiers (espace GED, pièces jointes, etc...). MinLength=Longueur minimale +NbMajMin=Nombre de majuscule minimum +NbNumMin=Nombre de chiffre minimum +NbSpeMin=Nombre de caractère speciaux minimum +NbIteConsecutive=Nombre maximum d'iterations consecutive du même caractère +NoAmbiCaracAutoGeneration=Desactivaté les caractère ambigus pour la generation automatique ("1","I","l","|","0","O") +SetupPerso=Configuration personalisable LanguageFilesCachedIntoShmopSharedMemory=Fichiers .lang en mémoire partagée ExamplesWithCurrentSetup=Exemples avec le paramétrage actif courant ListOfDirectories=Liste des répertoires des modèles OpenDocument @@ -1057,6 +1063,8 @@ EmptyNumRefModelDesc=Code libre sans vérification. Peut être modifié à tout ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés. PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement. +PasswordGenerationPerso=Renvoie un mot de passe généré selon votre configuration. +PasswordPatternDesc=Pattern utilisé pour la génération de password personalisé ##### Users setup ##### UserGroupSetup=Configuration module utilisateurs et groupes GeneratePassword=Proposer un mot de passe généré From a4a01de8a13d5b4425cc4ebf76358d5a18a92805 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 18:00:11 +0100 Subject: [PATCH 121/171] Fix: Missing label --- htdocs/core/lib/agenda.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index d2270cb5584..44e962de3ea 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -206,7 +206,7 @@ function show_array_actions_to_do($max=5) include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; $sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,"; - $sql.= " c.code, c.libelle,"; + $sql.= " c.code, c.libelle as type_label,"; $sql.= " s.nom as sname, s.rowid, s.client"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c LEFT JOIN "; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a ON c.id = a.fk_action"; @@ -243,7 +243,7 @@ function show_array_actions_to_do($max=5) print ''; $staticaction->type_code=$obj->code; - $staticaction->libelle=$obj->label; + $staticaction->label=($obj->label?$obj->label:$obj->type_label); $staticaction->id=$obj->id; print ''.$staticaction->getNomUrl(1,34).''; From b6b6cced307621bb97b8dcd1dd378deade696d9e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 20:02:11 +0100 Subject: [PATCH 122/171] Fix: Test sur user assigned not filled Can use empty line into select boolean form. --- htdocs/comm/action/card.php | 6 +++--- htdocs/core/class/html.form.class.php | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index a1e6f89f663..96db3133cf9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -251,11 +251,11 @@ if ($action == 'add') if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $object->use_phenix=1; // Check parameters - if (empty($object->userownerid)) + if (empty($object->userownerid) && empty($_SESSION['assignedtouser'])) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); } if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent)))) { @@ -423,7 +423,7 @@ if ($action == 'update') { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionAffectedTo")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); } // Fill array 'array_options' with data from add form diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8e369151fd7..eb7b3d8af4f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4166,18 +4166,18 @@ class Form /** * Return an html string with a select combo box to choose yes or no * - * @param string $htmlname Name of html select field - * @param string $value Pre-selected value - * @param int $option 0 return yes/no, 1 return 1/0 - * @param bool $disabled true or false - * @return mixed See option + * @param string $htmlname Name of html select field + * @param string $value Pre-selected value + * @param int $option 0 return yes/no, 1 return 1/0 + * @param bool $disabled true or false + * @param useempty $useempty 1=Add empty line + * @return mixed See option */ - function selectyesno($htmlname,$value='',$option=0,$disabled=false) + function selectyesno($htmlname,$value='',$option=0,$disabled=false,$useempty='') { global $langs; $yes="yes"; $no="no"; - if ($option) { $yes="1"; @@ -4187,15 +4187,17 @@ class Form $disabled = ($disabled ? ' disabled="disabled"' : ''); $resultyesno = ''."\n"; return $resultyesno; From 0b41df7c35a076be6ec128d98f4b15e9021b5290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Nov 2014 00:33:50 +0100 Subject: [PATCH 123/171] Clean code to manage multiselect jquery: All code is centralized into function multipleselectarray (except loading of css). Code is prepared to choose which plugin to use (only a if is required to switch or add a new manager). Introduce working version with multiple-select jquery plugin. Removed deprecated old jquery plugin. --- COPYRIGHT | 62 +-- htdocs/core/class/html.form.class.php | 86 ++-- .../jquery/plugins/multiple-select/LICENSE | 21 + .../jquery/plugins/multiple-select/README.md | 96 ++++ .../multiple-select/jquery.multiple.select.js | 466 +++++++++++++++++ .../multiple-select/multiple-select.css | 183 +++++++ .../multiple-select.jquery.json | 28 + .../multiple-select/multiple-select.png | Bin 0 -> 3342 bytes .../plugins/multiselect/MIT-LICENSE.txt | 20 - .../multiselect/css/ui.multiselect.css | 31 -- .../plugins/multiselect/js/ui.multiselect.js | 480 ------------------ htdocs/main.inc.php | 11 +- 12 files changed, 879 insertions(+), 605 deletions(-) create mode 100644 htdocs/includes/jquery/plugins/multiple-select/LICENSE create mode 100644 htdocs/includes/jquery/plugins/multiple-select/README.md create mode 100644 htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js create mode 100644 htdocs/includes/jquery/plugins/multiple-select/multiple-select.css create mode 100644 htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json create mode 100644 htdocs/includes/jquery/plugins/multiple-select/multiple-select.png delete mode 100644 htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt delete mode 100644 htdocs/includes/jquery/plugins/multiselect/css/ui.multiselect.css delete mode 100644 htdocs/includes/jquery/plugins/multiselect/js/ui.multiselect.js diff --git a/COPYRIGHT b/COPYRIGHT index c0d8389369c..fd54e10f354 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -9,41 +9,41 @@ More information: http://www.gnu.org/licenses/gpl-3.0.txt Dolibarr uses some external libraries released under different licenses. This is compatibility summary: -Component Version License GPL Compatible Usage +Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- PHP libraries: -AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) -CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG -FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management -FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management -GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) -NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) -odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files -PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files -PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests -TCPDF 6.0.093 LGPL-3+ Yes PDF generation +AdoDb-Date 0.32 Modified BSD License Yes Date convertion (not into rpm package) +CKEditor 4.3.3 LGPL-2.1+ Yes Editor WYSIWYG +FPDI 1.4.2 Apache Software License 2.0 Yes PDF templates management +FPDF_TPL 1.2 Apache Software License 2.0 Yes PDF templates management +GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) +NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) +odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files +PHPExcel 1.7.8 LGPL-2.1+ Yes Read/Write XLS files, read ODS files +PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +TCPDF 6.0.093 LGPL-3+ Yes PDF generation JS libraries: -jQuery 1.8.2 MIT License Yes JS library -jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI -jQuery UI Multiselect ? GPL and MIT License Yes JS library plugin for sexier multiselect -jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) -jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors -jQuery DataTables 1.9.4 BSD Yes JS library for tables output -jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files -jQuery Flot 0.7 MIT License Yes JS library to build graph -jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) -jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) -jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) -jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors -jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors -jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) -jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) -jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) -jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker -jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips -jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) +jQuery 1.8.2 MIT License Yes JS library +jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI +jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect +jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) +jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors +jQuery DataTables 1.9.4 BSD Yes JS library for tables output +jQuery FileUpload 5.0.3 GPL and MIT License Yes JS library to upload files +jQuery Flot 0.7 MIT License Yes JS library to build graph +jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) +jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) +jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups) +jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors +jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors +jQuery Layout 1.3.0rc30.74 GPL and MIT License Yes JS library plugin Layout (RC-29.15) +jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) +jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) +jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker +jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips +jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) For licenses compatibility informations: http://www.fsf.org/licensing/licenses/index_html diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eb7b3d8af4f..bade0344680 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4032,9 +4032,10 @@ class Form * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled - * @param int $sort 'ASC' or 'DESC' =Sort on label, '' or 'NONE'=Do not sort + * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param string $morecss Add more class to css styles * @return string HTML select string. + * @see multiselectarray */ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='') { @@ -4092,54 +4093,65 @@ class Form * * @param string $htmlname Name of select * @param array $array Array with key+value - * @param array $selected Preselected keys + * @param array $selected Array with key+value preselected * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key * @param string $option Valeur de l'option en fonction du type choisi * @param int $translate Translate and encode value + * @param int $width Force width of select box. May be used only when using jquery couch. * @return string HTML multiselect string + * @see selectarray */ - function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0) + static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $option='', $translate=0, $width=0) { global $conf, $langs; - $out = ''."\n"; if (is_array($array) && ! empty($array)) { if ($value_as_key) $array=array_combine($array, $array); - if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && is_array($selected) && ! empty($selected)) - { - foreach ($selected as $selected_value) - { - foreach($array as $key => $value) - { - if ($selected_value == $key) - { - $value=$array[$selected_value]; - $out.= ''."\n"; - unset($array[$key]); - } - } - } - - if (! empty($array)) - { - foreach ($array as $key => $value) - { - $out.= ''."\n"; - } - } - } - else + if (! empty($array)) { foreach ($array as $key => $value) { @@ -4150,7 +4162,7 @@ class Form } $out.= '>'; - $newval = ($translate ? $langs->trans(ucfirst($value)) : $value); + $newval = ($translate ? $langs->trans($value) : $value); $newval = ($key_in_label ? $key.' - '.$newval : $newval); $out.= dol_htmlentitiesbr($newval); $out.= ''."\n"; diff --git a/htdocs/includes/jquery/plugins/multiple-select/LICENSE b/htdocs/includes/jquery/plugins/multiple-select/LICENSE new file mode 100644 index 00000000000..c3ebd2b5248 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2012-2014 Zhixin Wen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/README.md b/htdocs/includes/jquery/plugins/multiple-select/README.md new file mode 100644 index 00000000000..81b82ba74c0 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/README.md @@ -0,0 +1,96 @@ +# Multiple Select + +Multiple select is a jQuery plugin to select multiple elements with checkboxes :). + +To get started checkout examples and documentation at http://wenzhixin.net.cn/p/multiple-select + +## Contributors + +Multiple select is due to the excellent work of the following contributors: + + + + +< + + + + + + + +
    文翼GitHub/wenzhixin
    Gaurav JassalGitHub/creativeaura
    guliGitHub/guli
    jwheadonGitHub/jwheadon
    yxGitHub/qqfish
    Tobias MaceyGitHub/blarghmatey
    Jona GoldmanGitHub/jonagoldman
    Alex JeffreyGitHub/ajeffrey
    + +## Changelog + +### 1.1.0 + +* Fix #63: Add ```keepOpen``` option. +* Fix #62: Fix ```isOpen``` and ```filter``` options are both true bug. +* Fix #57: Fire onCheckAll event when literally select. +* Add data attributes for support. +* Fix #55: Add ```name``` option. + +### 1.0.9 + +* Fix #42: Add ```styler``` option to custom item style. +* Fix firefox click bug. +* Add ```allSelected```, ```minumimCountSelected``` and ```countSelected``` options. +* Fix #35: Add ```onFocus``` and ```onBlur``` events. +* Fix #25: Add ```focus``` and ```blur``` methods. +* Fix #31: Trigger the onCheckAll & onUncheckAll events when use filter to select all. + +### 1.0.8 + +* Update the license to The MIT License. +* Fix #47: Add ```No matches found``` message when there are no results found. +* Fix #43: Add ```position``` option. + +### 1.0.7 + +* Fix #44: The filters not working bugs. + +### 1.0.6 + +* Fix #21: Add ```single``` option. +* Add ```override``` option. +* Add ```container``` option. +* Fix #29: Update the optgroups select text. +* Fix #30: Image is not shown in Firefox 25.0.1. +* Fix #22: fix group filter problem. + +### 1.0.5 + +* Update the button text witdh. +* Add keyboard support. + +### 1.0.4 + +* Fix #12: Add ```width``` option. +* Fix #11: Add callback events. +* Add ```maxHeight``` option. + +### 1.0.3 + +* Fix #4: Add ```filter``` option. +* Support mobile devices. +* Fix #6: Add ```refresh``` method. + +### 1.0.2 + +* Fix #7: Add ```selected``` and ```disabled``` options. +* Fix #5: Add ```checkAll``` and ```uncheckAll``` methods. + +### 1.0.1 + +* Fix #3: Add optgroups support. +* Add ```placeholder``` option. +* Fix #2: use prop method instead of attr. + +### 1.0.0 + +* Initial release + +## LICENSE + +[The MIT License](https://github.com/wenzhixin/multiple-select/blob/master/LICENSE) \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js new file mode 100644 index 00000000000..32e6635bbaa --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/jquery.multiple.select.js @@ -0,0 +1,466 @@ +/** + * @author zhixin wen + * @version 1.1.0 + * + * http://wenzhixin.net.cn/p/multiple-select/ + */ + +(function($) { + + 'use strict'; + + function MultipleSelect($el, options) { + var that = this, + name = $el.attr('name') || options.name || '', + elWidth = $el.width(); + + this.$el = $el.hide(); + this.options = options; + + this.$parent = $('
    '); + this.$choice = $(''); + this.$drop = $('
    '); + this.$el.after(this.$parent); + this.$parent.append(this.$choice); + this.$parent.append(this.$drop); + + if (this.$el.prop('disabled')) { + this.$choice.addClass('disabled'); + } + this.$choice.css('width', elWidth + 'px'); + this.$drop.css({ + width: (options.width || elWidth) + 'px' + }); + + if (!this.options.keepOpen) { + $('body').click(function(e) { + if ($(e.target)[0] === that.$choice[0] || + $(e.target).parents('.ms-choice')[0] === that.$choice[0]) { + return; + } + if (($(e.target)[0] === that.$drop[0] || + $(e.target).parents('.ms-drop')[0] !== that.$drop[0]) && + that.options.isOpen) { + that.close(); + } + }); + } + + this.selectAllName = 'name="selectAll' + name + '"'; + this.selectGroupName = 'name="selectGroup' + name + '"'; + this.selectItemName = 'name="selectItem' + name + '"'; + } + + MultipleSelect.prototype = { + constructor : MultipleSelect, + + init: function() { + var that = this, + html = []; + if (this.options.filter) { + html.push( + '' + ); + } + html.push('
      '); + if (this.options.selectAll && !this.options.single) { + html.push( + '
    • ', + '', + '
    • ' + ); + } + $.each(this.$el.children(), function(i, elm) { + html.push(that.optionToHtml(i, elm)); + }); + html.push('
    • No matches found
    • '); + html.push('
    '); + this.$drop.html(html.join('')); + this.$drop.find('ul').css('max-height', this.options.maxHeight + 'px'); + this.$drop.find('.multiple').css('width', this.options.multipleWidth + 'px'); + + this.$searchInput = this.$drop.find('.ms-search input'); + this.$selectAll = this.$drop.find('input[' + this.selectAllName + ']'); + this.$selectGroups = this.$drop.find('input[' + this.selectGroupName + ']'); + this.$selectItems = this.$drop.find('input[' + this.selectItemName + ']:enabled'); + this.$disableItems = this.$drop.find('input[' + this.selectItemName + ']:disabled'); + this.$noResults = this.$drop.find('.ms-no-results'); + this.events(); + this.update(); + + if (this.options.isOpen) { + this.open(); + } + }, + + optionToHtml: function(i, elm, group, groupDisabled) { + var that = this, + $elm = $(elm), + html = [], + multiple = this.options.multiple, + disabled, + type = this.options.single ? 'radio' : 'checkbox'; + + if ($elm.is('option')) { + var value = $elm.val(), + text = $elm.text(), + selected = $elm.prop('selected'), + style = this.options.styler(value) ? ' style="' + this.options.styler(value) + '"' : ''; + + disabled = groupDisabled || $elm.prop('disabled'); + html.push( + '', + '', + ' ', + text, + '', + '' + ); + } else if (!group && $elm.is('optgroup')) { + var _group = 'group_' + i, + label = $elm.attr('label'); + + disabled = $elm.prop('disabled'); + html.push( + '
  • ', + '', + '
  • '); + $.each($elm.children(), function(i, elm) { + html.push(that.optionToHtml(i, elm, _group, disabled)); + }); + } + return html.join(''); + }, + + events: function() { + var that = this; + this.$choice.off('click').on('click', function(e) { + e.preventDefault(); + that[that.options.isOpen ? 'close' : 'open'](); + }) + .off('focus').on('focus', this.options.onFocus) + .off('blur').on('blur', this.options.onBlur); + + this.$parent.off('keydown').on('keydown', function(e) { + switch (e.which) { + case 27: // esc key + that.close(); + that.$choice.focus(); + break; + } + }); + this.$searchInput.off('keyup').on('keyup', function() { + that.filter(); + }); + this.$selectAll.off('click').on('click', function() { + var checked = $(this).prop('checked'), + $items = that.$selectItems.filter(':visible'); + if ($items.length === that.$selectItems.length) { + that[checked ? 'checkAll' : 'uncheckAll'](); + } else { // when the filter option is true + that.$selectGroups.prop('checked', checked); + $items.prop('checked', checked); + that.options[checked ? 'onCheckAll' : 'onUncheckAll'](); + that.update(); + } + }); + this.$selectGroups.off('click').on('click', function() { + var group = $(this).parent().attr('data-group'), + $items = that.$selectItems.filter(':visible'), + $children = $items.filter('[data-group="' + group + '"]'), + checked = $children.length !== $children.filter(':checked').length; + $children.prop('checked', checked); + that.updateSelectAll(); + that.update(); + that.options.onOptgroupClick({ + label: $(this).parent().text(), + checked: checked, + children: $children.get() + }); + }); + this.$selectItems.off('click').on('click', function() { + that.updateSelectAll(); + that.update(); + that.updateOptGroupSelect(); + that.options.onClick({ + label: $(this).parent().text(), + value: $(this).val(), + checked: $(this).prop('checked') + }); + }); + }, + + open: function() { + if (this.$choice.hasClass('disabled')) { + return; + } + this.options.isOpen = true; + this.$choice.find('>div').addClass('open'); + this.$drop.show(); + if (this.options.container) { + var offset = this.$drop.offset(); + this.$drop.appendTo($(this.options.container)); + this.$drop.offset({ top: offset.top, left: offset.left }); + } + if (this.options.filter) { + this.$searchInput.val(''); + this.filter(); + } + this.options.onOpen(); + }, + + close: function() { + this.options.isOpen = false; + this.$choice.find('>div').removeClass('open'); + this.$drop.hide(); + if (this.options.container) { + this.$parent.append(this.$drop); + this.$drop.css({ + 'top': 'auto', + 'left': 'auto' + }) + } + this.options.onClose(); + }, + + update: function() { + var selects = this.getSelects('text'), + $span = this.$choice.find('>span'); + if (selects.length === this.$selectItems.length + this.$disableItems.length && this.options.allSelected) { + $span.removeClass('placeholder').html(this.options.allSelected); + } else if (selects.length > this.options.minumimCountSelected && this.options.countSelected) { + $span.removeClass('placeholder').html(this.options.countSelected + .replace('#', selects.length) + .replace('%', this.$selectItems.length + this.$disableItems.length)); + } else if (selects.length) { + $span.removeClass('placeholder').html(selects.join(', ')); + } else { + $span.addClass('placeholder').html(this.options.placeholder); + } + // set selects to select + this.$el.val(this.getSelects()); + }, + + updateSelectAll: function() { + var $items = this.$selectItems.filter(':visible'); + this.$selectAll.prop('checked', $items.length && + $items.length === $items.filter(':checked').length); + if (this.$selectAll.prop('checked')) { + this.options.onCheckAll(); + } + }, + + updateOptGroupSelect: function() { + var $items = this.$selectItems.filter(':visible'); + $.each(this.$selectGroups, function(i, val) { + var group = $(val).parent().attr('data-group'), + $children = $items.filter('[data-group="' + group + '"]'); + $(val).prop('checked', $children.length && + $children.length === $children.filter(':checked').length); + }); + }, + + //value or text, default: 'value' + getSelects: function(type) { + var that = this, + texts = [], + values = []; + this.$drop.find('input[' + this.selectItemName + ']:checked').each(function() { + texts.push($(this).parent().text()); + values.push($(this).val()); + }); + + if (type === 'text' && this.$selectGroups.length) { + texts = []; + this.$selectGroups.each(function() { + var html = [], + text = $.trim($(this).parent().text()), + group = $(this).parent().data('group'), + $children = that.$drop.find('[' + that.selectItemName + '][data-group="' + group + '"]'), + $selected = $children.filter(':checked'); + + if ($selected.length === 0) { + return; + } + + html.push('['); + html.push(text); + if ($children.length > $selected.length) { + var list = []; + $selected.each(function() { + list.push($(this).parent().text()); + }); + html.push(': ' + list.join(', ')); + } + html.push(']'); + texts.push(html.join('')); + }); + } + return type === 'text' ? texts : values; + }, + + setSelects: function(values) { + var that = this; + this.$selectItems.prop('checked', false); + $.each(values, function(i, value) { + that.$selectItems.filter('[value="' + value + '"]').prop('checked', true); + }); + this.$selectAll.prop('checked', this.$selectItems.length === + this.$selectItems.filter(':checked').length); + this.update(); + }, + + enable: function() { + this.$choice.removeClass('disabled'); + }, + + disable: function() { + this.$choice.addClass('disabled'); + }, + + checkAll: function() { + this.$selectItems.prop('checked', true); + this.$selectGroups.prop('checked', true); + this.$selectAll.prop('checked', true); + this.update(); + this.options.onCheckAll(); + }, + + uncheckAll: function() { + this.$selectItems.prop('checked', false); + this.$selectGroups.prop('checked', false); + this.$selectAll.prop('checked', false); + this.update(); + this.options.onUncheckAll(); + }, + + focus: function() { + this.$choice.focus(); + this.options.onFocus(); + }, + + blur: function() { + this.$choice.blur(); + this.options.onBlur(); + }, + + refresh: function() { + this.init(); + }, + + filter: function() { + var that = this, + text = $.trim(this.$searchInput.val()).toLowerCase(); + if (text.length === 0) { + this.$selectItems.parent().show(); + this.$disableItems.parent().show(); + this.$selectGroups.parent().show(); + } else { + this.$selectItems.each(function() { + var $parent = $(this).parent(); + $parent[$parent.text().toLowerCase().indexOf(text) < 0 ? 'hide' : 'show'](); + }); + this.$disableItems.parent().hide(); + this.$selectGroups.each(function() { + var $parent = $(this).parent(); + var group = $parent.attr('data-group'), + $items = that.$selectItems.filter(':visible'); + $parent[$items.filter('[data-group="' + group + '"]').length === 0 ? 'hide' : 'show'](); + }); + + //Check if no matches found + if (this.$selectItems.filter(':visible').length) { + this.$selectAll.parent().show(); + this.$noResults.hide(); + } else { + this.$selectAll.parent().hide(); + this.$noResults.show(); + } + } + this.updateOptGroupSelect(); + this.updateSelectAll(); + } + }; + + $.fn.multipleSelect = function() { + var option = arguments[0], + args = arguments, + + value, + allowedMethods = [ + 'getSelects', 'setSelects', + 'enable', 'disable', + 'checkAll', 'uncheckAll', + 'focus', 'blur', + 'refresh' + ]; + + this.each(function() { + var $this = $(this), + data = $this.data('multipleSelect'), + options = $.extend({}, $.fn.multipleSelect.defaults, + $this.data(), typeof option === 'object' && option); + + if (!data) { + data = new MultipleSelect($this, options); + $this.data('multipleSelect', data); + } + + if (typeof option === 'string') { + if ($.inArray(option, allowedMethods) < 0) { + throw "Unknown method: " + option; + } + value = data[option](args[1]); + } else { + data.init(); + } + }); + + return value ? value : this; + }; + + $.fn.multipleSelect.defaults = { + name: '', + isOpen: false, + placeholder: '', + selectAll: true, + selectAllText: 'Select all', + allSelected: 'All selected', + minumimCountSelected: 3, + countSelected: '# of % selected', + multiple: false, + multipleWidth: 80, + single: false, + filter: false, + width: undefined, + maxHeight: 250, + container: null, + position: 'bottom', + keepOpen: false, + + styler: function() {return false;}, + + onOpen: function() {return false;}, + onClose: function() {return false;}, + onCheckAll: function() {return false;}, + onUncheckAll: function() {return false;}, + onFocus: function() {return false;}, + onBlur: function() {return false;}, + onOptgroupClick: function() {return false;}, + onClick: function() {return false;} + }; +})(jQuery); diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css new file mode 100644 index 00000000000..d824e0c7a2b --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.css @@ -0,0 +1,183 @@ +/** + * @author zhixin wen + */ + +.ms-parent { + display: inline-block; + position: relative; + vertical-align: middle; +} + +.ms-choice { + display: block; + height: 26px; + padding: 0; + overflow: hidden; + cursor: pointer; + border: 1px solid #aaa; + text-align: left; + white-space: nowrap; + line-height: 26px; + color: #444; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + background-color: #fff; +} + +.ms-choice.disabled { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.ms-choice > span { + position: absolute; + top: 0; + left: 0; + right: 20px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: block; + padding-left: 8px; +} + +.ms-choice > span.placeholder { + color: #999; +} + +.ms-choice > div { + position: absolute; + top: 0; + right: 0; + width: 20px; + height: 25px; + background: url('multiple-select.png') right top no-repeat; +} + +.ms-choice > div.open { + background: url('multiple-select.png') left top no-repeat; +} + +.ms-drop { + overflow: hidden; + display: none; + margin-top: -1px; + padding: 0; + position: absolute; + z-index: 1000; + background: #fff; + color: #000; + border: 1px solid #aaa; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.ms-drop.bottom { + top: 100%; + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); +} + +.ms-drop.top { + bottom: 100%; + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.ms-search { + display: inline-block; + margin: 0; + min-height: 26px; + padding: 4px; + position: relative; + white-space: nowrap; + width: 100%; + z-index: 10000; +} + +.ms-search input { + width: 100%; + height: auto !important; + min-height: 24px; + padding: 0 20px 0 5px; + margin: 0; + outline: 0; + font-family: sans-serif; + font-size: 1em; + border: 1px solid #aaa; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + background: #fff url('multiple-select.png') no-repeat 100% -22px; + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('multiple-select.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('multiple-select.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); +} + +.ms-search, .ms-search input { + -webkit-box-sizing: border-box; + -khtml-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} + +.ms-drop ul { + overflow: auto; + margin: 0; + padding: 5px 8px; +} + +.ms-drop ul > li { + list-style: none; + display: list-item; + background-image: none; + position: static; +} + +.ms-drop ul > li .disabled { + opacity: .35; + filter: Alpha(Opacity=35); +} + +.ms-drop ul > li.multiple { + display: block; + float: left; +} + +.ms-drop ul > li.group { + clear: both; +} + +.ms-drop ul > li.multiple label { + width: 100%; + display: block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.ms-drop ul > li label.optgroup { + font-weight: bold; +} + +.ms-drop input[type="checkbox"] { + vertical-align: middle; +} + +.ms-drop .ms-no-results { + display: none; +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json new file mode 100644 index 00000000000..dd636fda7e0 --- /dev/null +++ b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.jquery.json @@ -0,0 +1,28 @@ +{ + "name": "multiple-select", + "version": "1.1.0", + "title": "Multiple Select", + "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).", + "author": { + "name": "zhixin wen", + "email": "wenzhixin2010@gmail.com", + "url": "http://wenzhixin.net.cn/" + }, + "licenses": [ + { + "type": "MIT License", + "url": "http://opensource.org/licenses/MIT" + } + ], + "dependencies": { + "jquery": ">=1.7" + }, + "keywords": ["multiple.select", "select.list", "multiple.choose", "checkbox"], + "homepage": "http://wenzhixin.net.cn/p/multiple-select/", + "demo": "http://wenzhixin.net.cn/p/multiple-select/#examples", + "bugs": { + "url": "https://github.com/wenzhixin/multiple-select/issues" + }, + "docs": "http://wenzhixin.net.cn/p/multiple-select/#documentation", + "download": "https://github.com/wenzhixin/multiple-select/archive/master.zip" +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png b/htdocs/includes/jquery/plugins/multiple-select/multiple-select.png new file mode 100644 index 0000000000000000000000000000000000000000..2a7ba608ea846d4873f84e00455ee2d1bbe4d13a GIT binary patch literal 3342 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 Y016sCsn^Dnga7~l07*qoM6N<$f>N').insertAfter(this.element); - this.count = 0; // number of currently selected options - this.selectedContainer = $('
    '); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.appendTo(this.container); - this.availableContainer = $('
    ').appendTo(this.container); - this.availableContainer.addClass('right-column'); - } - else - { - this.availableContainer = $('
    ').appendTo(this.container); - this.selectedContainer.appendTo(this.container); - this.selectedContainer.addClass('right-column'); - } - this.selectedActions = $('
    0 '+$.ui.multiselect.locale.itemsCount+''+(this.options.includeRemoveAll?''+$.ui.multiselect.locale.removeAll+'':' ')+'
    ').appendTo(this.selectedContainer); - this.availableActions = $('
    '+(this.options.includeAddAll?''+$.ui.multiselect.locale.addAll+'':' ')+'
    ').appendTo(this.availableContainer); - this.selectedList = $('
    ').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer); - this.availableList = $('
    ').bind('selectstart', function(){return false;}).appendTo(this.availableContainer); - - var that = this; - - var width = this.options.width; - if (!width) { - width = this.element.width(); - } - var height = this.options.height; - if (!height) { - height = this.element.height(); - } - - // set dimensions - this.container.width(width-2); - if (this.options.selectedContainerOnLeft) { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-1); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-2); - } - else - { - this.selectedContainer.width(Math.floor(width*this.options.dividerLocation)-2); - this.availableContainer.width(Math.floor(width*(1-this.options.dividerLocation))-1); - } - - // fix list height to match