From 5234e8fc8ff67c8a1192066cd23ef49f959b99bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Jun 2016 15:32:55 +0200 Subject: [PATCH 01/12] Update index.php --- htdocs/accountancy/customer/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 06446fdc908..6ed71946efe 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -95,7 +95,7 @@ if ($action == 'validatehistory') { $sql1 .= " SET fd.fk_code_ventilation = 0"; $sql1 .= ' WHERE fd.fk_code_ventilation NOT IN '; $sql1 .= ' (SELECT accnt.rowid '; - $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accountingaccount as accnt'; + $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt'; $sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst'; $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; @@ -393,4 +393,4 @@ print "\n"; print ''; llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); From 3646b5f5ae6bad2d95051975ba0077641781a11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Jun 2016 16:04:10 +0200 Subject: [PATCH 02/12] Update import.php --- htdocs/imports/import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index d2d0540ee80..944cac8a9b5 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -618,7 +618,7 @@ if ($step == 4 && $datatoimport) $obj->enclosure = $enclosure; } - if(!empty(GETPOST('update'))) { + if (GETPOST('update')) { $array_match_file_to_database=array(); } From f51386c59fb1c7964fd33028c7c524fc5a63e49d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 15 Jun 2016 08:06:22 +0200 Subject: [PATCH 03/12] FIX #5343 --- htdocs/install/mysql/migration/3.8.0-3.9.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 35ebf79e1ef..1a776c27e66 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -54,7 +54,7 @@ ALTER TABLE llx_askpricesupplier RENAME TO llx_supplier_proposal; ALTER TABLE llx_askpricesupplierdet RENAME TO llx_supplier_proposaldet; ALTER TABLE llx_askpricesupplier_extrafields RENAME TO llx_supplier_proposal_extrafields; ALTER TABLE llx_askpricesupplierdet_extrafields RENAME TO llx_supplier_proposaldet_extrafields; -ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_asksupplierprice fk_supplier_proposal integer NOT NULL; +ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; -- Fix bad data update llx_opensurvey_sondage set format = 'D' where format = 'D+'; @@ -610,4 +610,4 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14 -- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT; -ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50); \ No newline at end of file +ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50); From 748b3bb2bad930e317f8d1c0b21ca8adecb35e2b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 15 Jun 2016 14:16:56 +0200 Subject: [PATCH 04/12] Fix travis error for GETPOST in empty --- htdocs/imports/import.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index d2d0540ee80..6917eb5aeb0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -618,7 +618,8 @@ if ($step == 4 && $datatoimport) $obj->enclosure = $enclosure; } - if(!empty(GETPOST('update'))) { + $update = GETPOST('update'); + if(!empty($update)) { $array_match_file_to_database=array(); } From 9781baa743fbdcdcf72b7a9cc30ec25f25123b97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jun 2016 12:42:21 +0200 Subject: [PATCH 05/12] FIX Filter on opportunity amount and budget --- htdocs/projet/list.php | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f520e7ba1a6..e5370159742 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -70,6 +70,8 @@ $search_year=GETPOST("search_year"); $search_all=GETPOST("search_all"); $search_status=GETPOST("search_status",'int'); $search_opp_status=GETPOST("search_opp_status",'alpha'); +$search_opp_amount=GETPOST("search_opp_amount",'alpha'); +$search_budget_amount=GETPOST("search_budget_amount",'alpha'); $search_public=GETPOST("search_public",'int'); $search_user=GETPOST('search_user','int'); $search_sale=GETPOST('search_sale','int'); @@ -128,7 +130,8 @@ $arrayfields=array( 'p.public'=>array('label'=>$langs->trans("Visibility"), 'checked'=>1, 'position'=>102), 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>$conf->global->PROJECT_USE_OPPORTUNITIES, 'position'=>103), 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>$conf->global->PROJECT_USE_OPPORTUNITIES, 'position'=>104), - 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), + 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), + 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), ); @@ -158,6 +161,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_year=""; $search_status=-1; $search_opp_status=-1; + $search_opp_amount=''; + $search_budget_amount=''; $search_public=""; $search_sale=""; $search_user=''; @@ -208,7 +213,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; $distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.tms as date_update"; +$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.tms as date_update, p.budget_amount"; $sql.= ", s.nom as name, s.rowid as socid"; $sql.= ", cls.code as opp_status_code"; // Add fields for extrafields @@ -273,6 +278,8 @@ if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; if ($search_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_user; +if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1); +if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1); // Add where from extra fields foreach ($search_array_options as $key => $val) { @@ -327,6 +334,8 @@ if ($resql) if ($search_public != '') $param.='&search_public='.$search_public; if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; + if ($search_opp_amount != '') $param.='&search_opp_amount='.$search_opp_amount; + if ($search_budget_amount != '') $param.='&search_budget_amount='.$search_budget_amount; if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields foreach ($search_array_options as $key => $val) @@ -335,7 +344,7 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + $text=$langs->trans("Projects"); if ($search_user == $user->id) $text=$langs->trans('MyProjects'); print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num,'','title_project'); @@ -406,7 +415,8 @@ if ($resql) if (! empty($arrayfields['p.public']['checked'])) print_liste_field_titre($arrayfields['p.public']['label'],$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'],$_SERVER["PHP_SELF"],'p.fk_opp_status',"",$param,'align="center"',$sortfield,$sortorder); - // Extra fields + if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="center"',$sortfield,$sortorder); + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { foreach($extrafields->attribute_label as $key => $val) @@ -479,7 +489,8 @@ if ($resql) } if (! empty($arrayfields['p.opp_amount']['checked'])) { - print ''; + print ''; + print ''; print ''; } if (! empty($arrayfields['p.fk_opp_status']['checked'])) @@ -488,6 +499,12 @@ if ($resql) print $formproject->selectOpportunityStatus('search_opp_status',$search_opp_status,1,1,1); print ''; } + if (! empty($arrayfields['p.budget_amount']['checked'])) + { + print ''; + print ''; + print ''; + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -651,7 +668,7 @@ if ($resql) if (! empty($arrayfields['p.opp_amount']['checked'])) { print ''; - if ($obj->opp_status_code) print price($obj->opp_amount, 1, '', 1, - 1, - 1, $conf->currency); + if ($obj->opp_status_code) print price($obj->opp_amount, 1, '', 1, - 1, - 1); print ''; } if (! empty($arrayfields['p.fk_opp_status']['checked'])) @@ -660,6 +677,12 @@ if ($resql) if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); print ''; } + if (! empty($arrayfields['p.budget_amount']['checked'])) + { + print ''; + if ($obj->budget_amount != '') print price($obj->budget_amount, 1, '', 1, - 1, - 1); + print ''; + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { From f94d140d2a21b5b56adcb9de6517d73954056f43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Jun 2016 13:00:23 +0200 Subject: [PATCH 06/12] Fix bad sql field name --- 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 e6477fadf69..9d84ccd6bfe 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -472,8 +472,8 @@ if ($id > 0 || $ref) } // Stock alert threshold - print ''.$form->editfieldkey("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; - print $form->editfieldval("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer); + print ''.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; + print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer); print ''; // Desired stock From 5a51850d54368cc0583161ef6bbbc323ad4dd86a Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Thu, 16 Jun 2016 14:03:11 +0300 Subject: [PATCH 07/12] Greece VAT 23 -> 24 --- htdocs/install/mysql/data/llx_c_tva.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 4226413be59..860c416493a 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -107,7 +107,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 5 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 55, 5, '10.7','0','USt. Landwirtschaft', 0); -- GREECE (id country=102) -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2462, 102, 23, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2462, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2463, 102, 0, 0, '0', 0, '0', 0, 'Μηδενικό Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2464, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1); insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (2465, 102, 6.5, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1); From bc22f39aa45c25a67b0937c5ea6741281654f80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 16 Jun 2016 20:18:58 +0200 Subject: [PATCH 08/12] Update import.php --- htdocs/imports/import.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 944cac8a9b5..6917eb5aeb0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -618,7 +618,8 @@ if ($step == 4 && $datatoimport) $obj->enclosure = $enclosure; } - if (GETPOST('update')) { + $update = GETPOST('update'); + if(!empty($update)) { $array_match_file_to_database=array(); } From a3d53b269f8fd7448793c22d89d1a0e27af9c085 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2016 10:35:18 +0200 Subject: [PATCH 09/12] FIX javascript error with german-switzerland language --- htdocs/core/js/lib_head.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 234a2348590..e3b1d0ed691 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1032,7 +1032,7 @@ function price2numjs(amount) { if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { $thousand = $langs->transnoentitiesnoconv("SeparatorThousand"); } - print "var dec='" . $dec . "'; var thousand='" . $thousand . "';\n"; // Set var in javascript + print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript ?> var main_max_dec_shown = global->MAIN_MAX_DECIMALS_SHOWN); ?>; From d7177575949edd6066a524ce209b6ff7a9f2897d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Jun 2016 10:40:11 +0200 Subject: [PATCH 10/12] Protect against bad value of accurancy to avoid javascript error --- htdocs/core/js/lib_head.js.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index e3b1d0ed691..4d02acc9925 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1035,9 +1035,9 @@ function price2numjs(amount) { print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript ?> - var main_max_dec_shown = global->MAIN_MAX_DECIMALS_SHOWN); ?>; - var main_rounding_unit = global->MAIN_MAX_DECIMALS_UNIT; ?>; - var main_rounding_tot = global->MAIN_MAX_DECIMALS_TOT; ?>; + var main_max_dec_shown = global->MAIN_MAX_DECIMALS_SHOWN); ?>; + var main_rounding_unit = global->MAIN_MAX_DECIMALS_UNIT; ?>; + var main_rounding_tot = global->MAIN_MAX_DECIMALS_TOT; ?>; var amount = amount.toString(); From 386b19d4b1f91225c9e2207ce98494e72acdaca0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Jun 2016 17:56:34 +0200 Subject: [PATCH 11/12] Fix regression. Add hidden option PROPAL_DISABLE_SIGNATURE to restore old behaviour. --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 4b7ddc337b0..52f9a09ae9f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -647,8 +647,11 @@ class pdf_azur extends ModelePDFPropales */ // Customer signature area - $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); - + if (empty($conf->global->PROPAL_DISABLE_SIGNATURE)) + { + $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); + } + // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); From f514400d8781406fef3e9a3c2367ba5c75198e1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jun 2016 20:08:29 +0200 Subject: [PATCH 12/12] FIX a case of corrupted ODT by Word that insert when it should not. --- htdocs/includes/odtphp/odf.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 52750352afa..a60ed8fe32a 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -39,6 +39,7 @@ class Odf public $userdefined=array(); const PIXEL_TO_CM = 0.026458333; + /** * Class constructor * @@ -107,6 +108,7 @@ class Odf copy($filename, $this->tmpfile); + // Clean file to have tags for line corrected $this->_moveRowSegments(); } @@ -201,7 +203,9 @@ class Odf public function phpEval() { preg_match_all('/[\{\<]\?(php)?\s+(?P.+)\?[\}\>]/iU',$this->contentXml, $matches); // detecting all {?php code ?} or - for ($i=0;$i < count($matches['content']);$i++) { + $nbfound=count($matches['content']); + for ($i=0; $i < $nbfound; $i++) + { try { $ob_output = ''; // flush the output for each code. This var will be filled in by the eval($code) and output buffering : any print or echo or output will be redirected into this variable $code = $matches['content'][$i]; @@ -247,13 +251,18 @@ IMG; /** * Move segment tags for lines of tables - * Called automatically within the constructor + * This function is called automatically within the constructor, so this->contentXml is clean before any other thing * * @return void */ private function _moveRowSegments() { - // Search all possible rows in the document + // Replace BEGINxxx into BEGIN xxx + $this->contentXml = preg_replace('/\[!--\sBEGIN]>(row.[\S]*)\s--\]/sm', '[!-- BEGIN \\1 --]', $this->contentXml); + // Replace ENDxxx into END xxx + $this->contentXml = preg_replace('/\[!--\sEND]>(row.[\S]*)\s--\]/sm', '[!-- END \\1 --]', $this->contentXml); + + // Search all possible rows in the document $reg1 = "#]*>(.*)#smU"; preg_match_all($reg1, $this->contentXml, $matches); for ($i = 0, $size = count($matches[0]); $i < $size; $i++) { @@ -333,7 +342,7 @@ IMG; /** * Add the merged segment to the document * - * @param Segment $segment + * @param Segment $segment Segment * @throws OdfException * @return odf */ @@ -383,7 +392,7 @@ IMG; /** * Declare a segment in order to use it in a loop * - * @param string $segment + * @param string $segment Segment * @throws OdfException * @return Segment */ @@ -395,7 +404,7 @@ IMG; // $reg = "#\[!--\sBEGIN\s$segment\s--\]<\/text:p>(.*)\[!--\sEND\s$segment\s--\]#sm"; $reg = "#\[!--\sBEGIN\s$segment\s--\](.*)\[!--\sEND\s$segment\s--\]#sm"; if (preg_match($reg, html_entity_decode($this->contentXml), $m) == 0) { - throw new OdfException("'$segment' segment not found in the document"); + throw new OdfException("'".$segment."' segment not found in the document. The tag [!-- BEGIN xxx --] or [!-- END xxx --] is not present into content file."); } $this->segments[$segment] = new Segment($segment, $m[1], $this); return $this->segments[$segment]; @@ -674,9 +683,9 @@ IMG; /** * return the value present on odt in [valuename][/valuename] - * @param string $value name balise in the template - * @return string the value inside the balise - * + * + * @param string $value name balise in the template + * @return string the value inside the balise */ public function getvalue($valuename) { @@ -688,4 +697,3 @@ IMG; } -?>