From 3a053e3fedd5bb3b7668d128750461a6adc8b4ed Mon Sep 17 00:00:00 2001 From: Gregory DAVID Date: Fri, 7 Feb 2014 18:08:25 +0100 Subject: [PATCH 01/77] =?UTF-8?q?Donne=20la=20possibilit=C3=A9=20de=20fair?= =?UTF-8?q?e=20un=20filtrage=20sur=20les=20agenda=20en=20fonction=20du=20n?= =?UTF-8?q?um=C3=A9ro=20de=20projet=20pass=C3=A9=20en=20GET=20:=20&project?= =?UTF-8?q?=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 bc669f1702cf9b6efb3a04cdd3e37520f2d0900c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 9 Oct 2014 13:54:52 +0200 Subject: [PATCH 02/77] 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 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 03/77] 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 08/77] 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 09/77] 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 10/77] 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 14/77] 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 1eba744e8be7e1c307cc107860d238600ace9433 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 20 Oct 2014 13:15:48 +0200 Subject: [PATCH 23/77] Add hook method to simply display child lines in order/invoice/propal --- htdocs/core/class/commonobject.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9996337736a..e7cf4dbb7ee 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2566,6 +2566,11 @@ abstract class CommonObject $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline); $reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks } + else + { + $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'extrafieldsline'=>$extrafieldsline); + $reshook=$hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + } } else { From c103a5927a9596cb34747556789b26d9c2854314 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 20 Oct 2014 22:28:08 +0200 Subject: [PATCH 24/77] 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 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 25/77] 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 26/77] 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 27/77] 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 28/77] 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 15/77] 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 16/77] 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 17/77] 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 18/77] 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 19/77] 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 20/77] 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 21/77] 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 22/77] 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 29/77] "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 38/77] 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 39/77] 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 40/77] 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 41/77] 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 efd99a6f44003a6f8d353b2e318572cb20b0e8bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 27 Oct 2014 10:20:35 +0100 Subject: [PATCH 42/77] 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 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 36/77] 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 30/77] 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 31/77] 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 32/77] 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 33/77] 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 34/77] 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 35/77] 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 37/77] 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 '
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 43/77] 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 44/77] 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 45/77] 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 46/77] 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 47/77] 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 a32817db9d0088e56be192bc76519f0b8214135f Mon Sep 17 00:00:00 2001 From: jfefe Date: Tue, 28 Oct 2014 23:49:54 +0100 Subject: [PATCH 48/77] 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 49/77] 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 50/77] 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 51/77] 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 38a939771c1dd1a403df94b6b7dad77472ec41f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 17:16:51 +0100 Subject: [PATCH 52/77] 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 53/77] 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 54/77] 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 d5f21caca607b5e652981a4bf19bc40fa35e4309 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 18:19:41 +0100 Subject: [PATCH 55/77] 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 2f5c7e5f9d9c29e51e9c915c7bc05ae09150ce98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 19:28:22 +0100 Subject: [PATCH 56/77] 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 24862d6314c66cffd6fa21d8a7a7984c8846e07b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Oct 2014 22:51:06 +0100 Subject: [PATCH 57/77] 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 58/77] 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 9c51effe5cbddf5a3ec01ca2999d433967d08d0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Oct 2014 15:41:58 +0100 Subject: [PATCH 59/77] 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 82aa8458bf7d5f745bd21a6b7cc8d7924c236d0e Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Fri, 31 Oct 2014 17:46:11 +0100 Subject: [PATCH 60/77] 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 b8faed9fe80700c2be56ca3f7469277cf9a41352 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Nov 2014 19:50:56 +0100 Subject: [PATCH 61/77] 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 62/77] 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 zcmWKXc{~&TAIG~(emW>B-LA@2Um_4%8+qP{omUnO2ZQHi}-*Nl4 zeLMdR@K>it|Hke6_a5C|US6J`pP!qXTUl9|ot<4>U7eYknVz0rTU(o&nwp%P6bJ+p z6BB$spUGq{EG+!_^Jj5!k;mh)*=#PCyR@{#;c#{Z1`hnY@c6UaPR||&`#gg^3H9D~ z!zZA8iLbYv_Y<$kr=8x$+qQW^EN|U-6tR8R#P%xhv8r929B3Vrmv#1W>f4aQ zt^3{rpxy#x-~_nRe!svpjFkwuC{}gS%#0scB;~IzIir(4s;ZJ$gJ0FW(w8KDj<0)Q zCm65#(hFV(q@&R>X=j~<_4DAb^(LdNhd#50Q@~Z`Y!sXFb{s#_B)n-W6?u??64#~@ zr>W_XYM9CG9G;da>kCFuqB);wZ9X{UZiijeb-tFiBhnU8#Hk%?h|GJ=bVFE}P5ONG>Dpz0R2RAA4Zjaw#4u07xOc_-&5>?64 zf=jS*ISaI-gINJ=OKe%<$3EJbk7rN8$NoB87QJR7i=}+d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ObYIbI-Io@DpD!{Vzhl6z|ynMy^6L4Va_T~ckB=!B!gMysWHL_)dGFJVy zFEMn(RV$ra3kTEb%S>V!AZMYJHge3<$LQwM4N{TZSC&Tt?}hpx+D-p1Zo()SEe0Hc z%vVjW&?n0{CYv#v!hVwmw7KUehbLMITUB>iEF7<-Du-ZAxz8~I-ixTVkZ z7kiM9vn*6K;P}L-0cp1;%ff%#g34DVxxSidv3^~YLKt~zHpNGD%;t!W`15rveGrdU zEr&7KFNsDs2H7(Ofcb69>#mEk#I;1Zd`rujjjgA5ZmKdT=jfW2u5;5BIStBg3WlY 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 63/77] 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 b74bdb8f7d08bf192b129b514145cfdc48ca19f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 11:39:30 +0100 Subject: [PATCH 64/77] 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 65/77] 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 2b8abf27941312a193b107f1468abd7e2223afc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 20:07:38 +0100 Subject: [PATCH 66/77] 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 5a18904bb48f19d792c7eb1afbde8c33efafb4a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Nov 2014 21:16:31 +0100 Subject: [PATCH 67/77] 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 68/77] 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 ddf737daed9e5ea7d5ab6223570be68e089044c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 01:07:07 +0100 Subject: [PATCH 69/77] 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 ''; - - $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).''; // Date start - print ''.$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 ''; - 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 ''; print ''; // Date end - 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 ''; // Location - print ''.$langs->trans("Location").''.$object->location.''; + if (empty($conf->global->AGENDA_DISABLE_LOCATION)) + { + print ''.$langs->trans("Location").''.$object->location.''; + } // Assigned to - print ''.$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 ''; + 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 '

'; @@ -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 b2ed53b78563fd4d64c202b43d4ff2318f7c25f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Nov 2014 15:47:33 +0100 Subject: [PATCH 70/77] 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 '', + '' + ); + } 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 zcmV+p4e|1cP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0mFKEdRdZE8)p@E5RI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`>RI+y?e7jKeZ#YO-C z0y{}WK~#9!?3X)e6j2n0zq1=3V01+ht#msfAc%-)BQ`$3M$p2DVk2n`SooN;yTn4- znLC26k0PjzjfjYam81}?ZDM1QLXiY*OtV`=*er8w?n2Nty0V*DWDXo=?t^>3IhX&Q zGh${8vgH_X%K$UL3@`)ix0%^5-fIhjpb&=P=0EM*$%i^E7)8-&k|Y8oOS)G#8jV+R z9M`)AEEEd&MPwUrv?oVwX1nwG{L_3s|E%q~Tuz(KX0zK3s@3Wq5jiI!N2=B8;hq4N z%jLk#UMvA#Op@eGtycTq^#-|IO+>`M-yItpTh$Yhv|6o_nJsw02bD_YeYbE?6kQdO zgYCA6j1-GS*Au{riHVQEq?tA9_4;!_@CybTASs_%eXz$RdCnkwD^ESlL&hp}n@T$?7~EU-pIj&~Rv_0j#7nn>a} z9sxc8^T1hEopR0%1LHsh%&O{+)I{P{d>(k>yJmomz*gT*fZM8iEj2)|+Wo*KV3&t_ z2@C^Q{M0+DdO0<~WiId#DEa0+pd19j!ocKWRV@S8fkhwT0|QqqsOnANtv~v&Kac+y 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