diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 7f0b2be0071..d0191d92c09 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,31 +30,31 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // extends CommonObject { - /** + /** * @var DoliDB Database handler. */ public $db; - + /** * @var string Error string * @see errors */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var string ID to identify managed object */ - public $element='c_accounting_category'; - + public $element='c_accounting_category'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element='c_accounting_category'; + public $table_element='c_accounting_category'; public $id; public $code; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 60cb8d0c53a..c6848bfe689 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -80,15 +80,23 @@ class AccountingAccount extends CommonObject var $account_parent; var $account_category; - /** - * @var string proper name for given parameter - */ - public $label; + /** + * @var string Label of account + */ + public $label; - var $fk_user_author; - var $fk_user_modif; - var $active; // duplicate with status - var $status; + /** + * @var int ID + */ + public $fk_user_author; + + /** + * @var int ID + */ + public $fk_user_modif; + + public $active; // duplicate with status + public $status; /** @@ -422,7 +430,7 @@ class AccountingAccount extends CommonObject * @param string $moretitle Add more text to title tooltip * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @return string String with URL + * @return string String with URL */ function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1) { diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index b51413be369..8b88d6437e0 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -31,7 +31,7 @@ abstract class ActionsAdherentCardCommon * @var DoliDB Database handler. */ public $db; - + var $dirmodule; var $targetmodule; var $canvas; @@ -41,11 +41,11 @@ abstract class ActionsAdherentCardCommon var $tpl = array(); //! Object container var $object; - + /** * @var string Error code (or message) */ - public $error=''; + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 838101b7f7b..27ddd47088e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -45,12 +45,12 @@ class Adherent extends CommonObject * @var string ID to identify managed object */ public $element='member'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='adherent'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $mesgs; @@ -543,10 +543,10 @@ class Adherent extends CommonObject $luser->birth=$this->birth; $luser->address=$this->address; $luser->zip=$this->zip; - $luser->town=$this->town; - $luser->country_id=$this->country_id; + $luser->town=$this->town; + $luser->country_id=$this->country_id; $luser->state_id=$this->state_id; - + $luser->email=$this->email; $luser->skype=$this->skype; $luser->office_phone=$this->phone; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 13d72acb3d7..519d6c8c08a 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -303,9 +303,11 @@ if ($object->fetch($id) >= 0) // Sort $modulenames sort($modulenames); + $var = true; + // Loop on each submodule - foreach($modulenames as $modulename) - { + foreach($modulenames as $modulename) + { // Loading Class $file = $dir.$modulename.".modules.php"; $classname = "mailing_".$modulename; @@ -326,14 +328,18 @@ if ($object->fetch($id) >= 0) } // Si le module mailing est qualifie + if ($qualified) + { + $var = ! $var; + if ($allowaddtarget) { - print '
'; + print ''; print ''; } else { - print '
'; + print '
'; } print '
'; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 21d16d0605d..abdbf2024af 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -28,10 +28,10 @@ */ class AdvanceTargetingMailing extends CommonObject { - /** - * @var DoliDB Database handler. - */ - public $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) @@ -75,9 +75,9 @@ class AdvanceTargetingMailing extends CommonObject /** - * Constructor + * Constructor * - * @param DoliDb $db Database handler + * @param DoliDb $db Database handler */ function __construct($db) { diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index fffb69bea2f..3fdcd6178b0 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -30,7 +30,7 @@ class FormAdvTargetEmailing extends Form * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -378,10 +378,10 @@ class FormAdvTargetEmailing extends Form /** * Return combo list of categories * - * @param string $htmlname Name of categorie - * @param array $selected_array value selected - * @param int $type type - * @return string HTML combo + * @param string $htmlname Name of categorie + * @param array $selected_array Value selected + * @param int $type Type + * @return string HTML combo */ public function multiselectCategories($htmlname='',$selected_array = array(), $type=0) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f2a137f0d8f..edabffe98ca 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3705,7 +3705,7 @@ else if ($id > 0 || ! empty($ref)) $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, $object->id); if ($result > 0){ - print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'
'; + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'
'; } } print ''; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index c2c8bee9904..babdcf86152 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -32,13 +32,13 @@ class Localtax extends CommonObject /** * @var string ID to identify managed object */ - public $element='localtax'; - + public $element='localtax'; + /** * @var string Name of table without prefix where object is stored */ public $table_element='localtax'; - + public $picto='payment'; var $ltt; @@ -46,12 +46,12 @@ class Localtax extends CommonObject var $datep; var $datev; var $amount; - + /** * @var string proper name for given parameter */ public $label; - + var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 76dfd8491ba..bee34153da1 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -35,12 +35,12 @@ class PaymentSalary extends CommonObject * @var string ID to identify managed object */ public $element='payment_salary'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='payment_salary'; - + public $table_element='payment_salary'; + public $picto='payment'; public $tms; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 60b31b85689..07d637075f5 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -35,12 +35,12 @@ class PaymentSocialContribution extends CommonObject * @var string ID to identify managed object */ public $element='paiementcharge'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='paiementcharge'; - + public $table_element='paiementcharge'; + public $picto = 'payment'; var $fk_charge; diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index f69cc85e026..8d1c5cd712c 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -158,8 +158,8 @@ print ''."\n"; //print ''."\n"; $param=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:''); -if (! empty($website)) $param.='&website='.$website; -if (! empty($pageid)) $param.='&pageid='.$pageid; +if (! empty($websitekey)) $param.='&website='.$websitekey; +if (! empty($pageid)) $param.='&pageid='.$pageid; // Dir scan @@ -234,7 +234,7 @@ if ($type == 'directory') $param.='&file_manager=1'; if (!preg_match('/website=/',$param)) $param.='&website='.urlencode(GETPOST('website','alpha')); if (!preg_match('/pageid=/',$param)) $param.='&pageid='.urlencode(GETPOST('pageid','int')); - //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$website.'&pageid='.$pageid); + //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid); } } else @@ -315,7 +315,7 @@ if ($useajax || $action == 'delete') $formquestion['section_id']=array('type'=>'hidden','value'=>$section_id,'name'=>'section_id'); // We must always put field, even if empty because it is fille by javascript later $formquestion['section_dir']=array('type'=>'hidden','value'=>$section_dir,'name'=>'section_dir'); // We must always put field, even if empty because it is fille by javascript later if (! empty($action) && $action == 'file_manager') $formquestion['file_manager']=array('type'=>'hidden','value'=>1,'name'=>'file_manager'); - if (! empty($website)) $formquestion['website']=array('type'=>'hidden','value'=>$website,'name'=>'website'); + if (! empty($websitekey)) $formquestion['website']=array('type'=>'hidden','value'=>$websitekey,'name'=>'website'); if (! empty($pageid) && $pageid > 0) $formquestion['pageid']=array('type'=>'hidden','value'=>$pageid,'name'=>'pageid'); print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0)); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index cfff81749de..4b588751829 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -201,7 +201,7 @@ if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE // Edit link print ''.img_edit($langs->trans("Edit").' - '.$langs->trans("View"), 0, 'class="valignmiddle opacitymedium"').''; // Add link diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 47782f5f3c6..518f02ef2af 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -1,4 +1,21 @@ . + * or see http://www.gnu.org/ + */ + /** * Class to manage comment */ @@ -8,11 +25,11 @@ class Comment extends CommonObject * @var string ID to identify managed object */ public $element='comment'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='comment'; + public $table_element='comment'; public $fk_element; public $element_type; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b34eae4001b..7f2e8738201 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -46,58 +46,58 @@ abstract class CommonObject * @var DoliDb Database handler (result of a new DoliDB) */ public $db; - + /** * @var int The object identifier */ public $id; - + /** * @var string Error string * @see errors */ public $error; - + /** * @var string[] Array of error strings */ public $errors=array(); - + /** * @var string ID to identify managed object */ public $element; - + /** * @var string Name of table without prefix where object is stored */ public $table_element; - + /** * @var */ public $table_element_line; - + /** * @var string Key value used to track if data is coming from import wizard */ public $import_key; - + /** * @var mixed Contains data to manage extrafields */ public $array_options=array(); - + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ public $linkedObjectsIds; - + /** * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked */ public $linkedObjects; - + /** * @var Object To store a cloned copy of object before to edit it and keep track of old properties */ @@ -127,13 +127,13 @@ abstract class CommonObject * @see fetch_projet() */ public $project; - + /** * @var int The related project ID * @see setProject(), project */ public $fk_project; - + /** * @deprecated * @see project @@ -145,7 +145,7 @@ abstract class CommonObject * @see fetch_contact() */ public $contact; - + /** * @var int The related contact ID * @see fetch_contact() @@ -179,17 +179,17 @@ abstract class CommonObject * @var string The object's reference */ public $ref; - + /** * @var string The object's previous reference */ public $ref_previous; - + /** * @var string The object's next reference */ public $ref_next; - + /** * @var string An external reference for the object */ @@ -206,43 +206,43 @@ abstract class CommonObject * @see getFullAddress() */ public $country; - + /** * @var int * @see getFullAddress(), country */ public $country_id; - + /** * @var string * @see getFullAddress(), isInEEC(), country */ public $country_code; - + /** * @var string * @see getFullAddress() */ public $state; - + /** * @var int * @see getFullAddress(), state */ public $state_id; - + /** * @var string * @see getFullAddress(), state */ public $state_code; - + /** * @var string * @see getFullAddress(), region */ public $region; - + /** * @var string * @see getFullAddress(), region @@ -254,19 +254,19 @@ abstract class CommonObject * @see fetch_barcode() */ public $barcode_type; - + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_code; - + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_label; - + /** * @var string * @see fetch_barcode(), barcode_type @@ -284,7 +284,7 @@ abstract class CommonObject * @see setPaymentTerms() */ public $cond_reglement_id; - + /** * @var int Payment terms ID * @deprecated Kept for compatibility @@ -322,13 +322,13 @@ abstract class CommonObject * @see update_note() */ public $note_public; - + /** * @var string Private note * @see update_note() */ public $note_private; - + /** * @deprecated * @see note_public @@ -340,25 +340,25 @@ abstract class CommonObject * @see update_price() */ public $total_ht; - + /** * @var float Total VAT amount * @see update_price() */ public $total_tva; - + /** * @var float Total local tax 1 amount * @see update_price() */ public $total_localtax1; - + /** * @var float Total local tax 2 amount * @see update_price() */ public $total_localtax2; - + /** * @var float Total amount with taxes * @see update_price() @@ -381,13 +381,13 @@ abstract class CommonObject * @see setIncoterms() */ public $fk_incoterms; - + /** * @var string * @see SetIncoterms() */ public $libelle_incoterms; - + /** * @var string * @see display_incoterms() @@ -3786,7 +3786,7 @@ abstract class CommonObject $num = count($this->lines); - //Line extrafield + // Line extrafield require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafieldsline = new ExtraFields($this->db); $extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line); @@ -3795,6 +3795,7 @@ abstract class CommonObject $reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { + // Title line print "\n"; print ''; @@ -3886,7 +3887,6 @@ abstract class CommonObject //Line extrafield $line->fetch_optionals(); - //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) if (is_object($hookmanager)) // Old code is commented on preceding line. { diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index bbdf7e9c3ab..6a2374a7d3b 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -30,7 +30,7 @@ /** - * Events class + * Events class */ class Events // extends CommonObject { @@ -38,18 +38,18 @@ class Events // extends CommonObject * @var string ID to identify managed object */ public $element='events'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='events'; + public $table_element='events'; /** * @var int ID */ public $id; - - /** + + /** * @var DoliDB Database handler. */ public $db; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 715f17b5a92..d1276610830 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -31,17 +31,17 @@ class Menubase /** * @var DoliDB Database handler. */ - public $db; - + public $db; + /** - * @var string Error code (or message) - */ - public $error; - + * @var string Error code (or message) + */ + public $error; + /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); + * @var string[] Error codes (or messages) + */ + public $errors = array(); public $id; @@ -696,4 +696,3 @@ class Menubase } } - diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 40c1ff5187c..a63839ac526 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1327,8 +1327,10 @@ class DolibarrModules // Can not be abstract, because we need to insta $status = isset($this->cronjobs[$key]['status'])?$this->cronjobs[$key]['status']:''; $priority = isset($this->cronjobs[$key]['priority'])?$this->cronjobs[$key]['priority']:''; $test = isset($this->cronjobs[$key]['test'])?$this->cronjobs[$key]['test']:''; // Line must be visible + $datestart = isset($this->cronjobs[$key]['datestart'])?$this->cronjobs[$key]['datestart']:''; + $dateend = isset($this->cronjobs[$key]['dateend'])?$this->cronjobs[$key]['dateend']:''; - // Search if boxes def already present + // Search if cron entry already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; if ($class) $sql.= " AND classesname = '".$this->db->escape($class)."'"; @@ -1349,7 +1351,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (! $err) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, label, jobtype, classesname, objectname, methodename, command, params, note,"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,"; if(is_int($frequency)){ $sql.= ' frequency,'; } if(is_int($unitfrequency)){ $sql.= ' unitfrequency,'; } if(is_int($priority)){ $sql.= ' priority,'; } @@ -1358,7 +1360,8 @@ class DolibarrModules // Can not be abstract, because we need to insta $sql.= " VALUES ("; $sql.= "'".$this->db->escape($this->rights_class)."', "; $sql.= "'".$this->db->idate($now)."', "; - $sql.= "'".$this->db->idate($now)."', "; + $sql.= ($datestart ? "'".$this->db->idate($datestart)."'" : "NULL").", "; + $sql.= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", "; $sql.= "'".$this->db->escape($label)."', "; $sql.= "'".$this->db->escape($jobtype)."', "; $sql.= ($class?"'".$this->db->escape($class)."'":"null").","; @@ -1393,7 +1396,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // else box already registered into database } else - { + { $this->error=$this->db->lasterror(); $err++; } diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index b60941f4eeb..baf2a66c399 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -74,7 +74,7 @@ print '
'; if ($permtoadd) { - print ''; + print ''; print ''; print ''; } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 657653c9997..02fd4a95643 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -34,12 +34,12 @@ class Cronjob extends CommonObject * @var string ID to identify managed object */ public $element='cronjob'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='cronjob'; - + public $table_element='cronjob'; + public $picto = 'cron'; public $entity; diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 092bc77fbb2..2db4c401818 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -32,13 +32,13 @@ class PaymentDonation extends CommonObject /** * @var string ID to identify managed object */ - public $element='payment_donation'; - + public $element='payment_donation'; + /** * @var string Name of table without prefix where object is stored */ public $table_element='payment_donation'; - + public $picto = 'payment'; public $rowid; @@ -76,7 +76,7 @@ class PaymentDonation extends CommonObject * Use this->amounts to have list of lines for the payment * * @param User $user User making payment - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, id of payment if OK */ function create($user, $notrigger=false) diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 540b584590b..18a5fdbec6b 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -31,8 +31,8 @@ class ExpeditionLineBatch extends CommonObject /** * @var string ID to identify managed object */ - public $element='expeditionlignebatch'; - + public $element='expeditionlignebatch'; + private static $_table_element='expeditiondet_batch'; //!< Name of table without prefix where object is stored var $sellby; @@ -63,15 +63,15 @@ class ExpeditionLineBatch extends CommonObject function fetchFromStock($id_stockdluo) { $sql = "SELECT"; - $sql.= " pb.batch,"; - $sql.= " pl.sellby,"; - $sql.= " pl.eatby,"; - $sql.= " ps.fk_entrepot"; + $sql.= " pb.batch,"; + $sql.= " pl.sellby,"; + $sql.= " pl.eatby,"; + $sql.= " ps.fk_entrepot"; $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; $sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product"; - $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; + $sql.= " WHERE pb.rowid = ".(int) $id_stockdluo; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index aea15e13502..fb872ca2f5c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -37,12 +37,12 @@ class ExpenseReport extends CommonObject * @var string ID to identify managed object */ public $element='expensereport'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='expensereport'; - + var $table_element_line = 'expensereport_det'; var $fk_element = 'fk_expensereport'; var $picto = 'trip'; @@ -2403,7 +2403,7 @@ class ExpenseReportLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 52e866a80ec..732d55de298 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -34,12 +34,12 @@ class PaymentExpenseReport extends CommonObject * @var string ID to identify managed object */ public $element='payment_expensereport'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='payment_expensereport'; - + public $table_element='payment_expensereport'; + public $picto = 'payment'; var $rowid; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 688f08e9666..5e4a18c32b3 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -44,22 +44,22 @@ class CommandeFournisseur extends CommonOrder * @var string ID to identify managed object */ public $element='order_supplier'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='commande_fournisseur'; - + public $table_element_line = 'commande_fournisseurdet'; public $fk_element = 'fk_commande'; public $picto='order'; - + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; - + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -78,7 +78,7 @@ class CommandeFournisseur extends CommonOrder * @var string */ public $ref; - + public $ref_supplier; public $brouillon; public $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Ordered/Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially @@ -3109,7 +3109,7 @@ class CommandeFournisseurLigne extends CommonOrderLine * @var string ID to identify managed object */ public $element='commande_fournisseurdet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index b2e5be57236..619ffd1d060 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -34,26 +34,26 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class CommandeFournisseurDispatch extends CommonObject { - /** + /** * @var DoliDB Database handler. */ - public $db; - + public $db; + /** * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var string ID to identify managed object */ public $element='commandefournisseurdispatch'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2db826d4f5f..f9f352c1f70 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -45,22 +45,22 @@ class FactureFournisseur extends CommonInvoice * @var string ID to identify managed object */ public $element='invoice_supplier'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture_fourn'; - + public $table_element_line='facture_fourn_det'; public $fk_element='fk_facture_fourn'; public $picto='bill'; - + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; - + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -110,13 +110,13 @@ class FactureFournisseur extends CommonInvoice public $total_localtax1=0; public $total_localtax2=0; public $total_ttc=0; - + /** * @deprecated * @see note_private, note_public */ public $note; - + public $note_private; public $note_public; public $propalid; @@ -676,7 +676,9 @@ class FactureFournisseur extends CommonInvoice // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { - $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; + $this->lines = array(); + + $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; $sql.= ', f.localtax1_tx, f.localtax2_tx, f.localtax1_type, f.localtax2_type, f.total_localtax1, f.total_localtax2, f.fk_facture_fourn '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; @@ -686,7 +688,6 @@ class FactureFournisseur extends CommonInvoice $sql.= ' WHERE fk_facture_fourn='.$this->id; $sql.= ' ORDER BY f.rang, f.rowid'; - dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql_rows = $this->db->query($sql); if ($resql_rows) @@ -704,6 +705,9 @@ class FactureFournisseur extends CommonInvoice $line->id = $obj->rowid; $line->rowid = $obj->rowid; $line->description = $obj->description; + $line->date_start = $obj->date_start; + $line->date_end = $obj->date_end; + $line->product_ref = $obj->product_ref; $line->ref = $obj->product_ref; $line->ref_supplier = $obj->ref_supplier; @@ -1741,7 +1745,7 @@ class FactureFournisseur extends CommonInvoice public function updateline($id, $desc, $pu, $vatrate, $txlocaltax1=0, $txlocaltax2=0, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0, $remise_percent=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit = null, $pu_ht_devise=0, $ref_supplier='') { global $mysoc; - dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$fk_unit,$pu_ht_devise,$ref_supplier", LOG_DEBUG); + dol_syslog(get_class($this)."::updateline $id,$desc,$pu,$vatrate,$qty,$idproduct,$price_base_type,$info_bits,$type,$remise_percent,$notrigger,$date_start,$date_end,$fk_unit,$pu_ht_devise,$ref_supplier", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $pu = price2num($pu); @@ -1821,6 +1825,9 @@ class FactureFournisseur extends CommonInvoice $line->remise_percent = $remise_percent; $line->ref_supplier = $ref_supplier; + $line->date_start = $date_start; + $line->date_end = $date_end; + $line->vat_src_code=$vat_src_code; $line->tva_tx = $vatrate; $line->localtax1_tx = $txlocaltax1; @@ -2581,7 +2588,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @var string ID to identify managed object */ public $element='facture_fourn_det'; - + /** * @var string Name of table without prefix where object is stored */ @@ -2594,7 +2601,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see product_ref */ public $ref; - + /** * Internal ref * @var string @@ -2613,7 +2620,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see label */ public $libelle; - + /** * Product description * @var string @@ -2627,7 +2634,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see subprice */ public $pu_ht; - + public $subprice; /** @@ -2643,7 +2650,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see total_tva */ public $tva; - + public $total_tva; /** @@ -2665,6 +2672,9 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $description; + public $date_start; + public $date_end; + public $skip_update_total; // Skip update price total for special lines /** @@ -2722,7 +2732,7 @@ class SupplierInvoiceLine extends CommonObjectLine */ public function fetch($rowid) { - $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; + $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx'; $sql.= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2 '; $sql.= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit'; $sql.= ', p.rowid as product_id, p.ref as product_ref, p.label as label, p.description as product_desc'; @@ -2749,6 +2759,8 @@ class SupplierInvoiceLine extends CommonObjectLine $this->rowid = $obj->rowid; $this->fk_facture_fourn = $obj->fk_facture_fourn; $this->description = $obj->description; + $this->date_start = $obj->date_start; + $this->date_end = $obj->date_end; $this->product_ref = $obj->product_ref; $this->ref_supplier = $obj->ref_supplier; $this->libelle = $obj->label; @@ -2880,6 +2892,8 @@ class SupplierInvoiceLine extends CommonObjectLine $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET"; $sql.= " description ='".$this->db->escape($this->description)."'"; $sql.= ", ref ='".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'"; + $sql.= ", date_start = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null"); + $sql.= ", date_end = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql.= ", pu_ht = ".price2num($this->pu_ht); $sql.= ", pu_ttc = ".price2num($this->pu_ttc); $sql.= ", qty = ".price2num($this->qty); @@ -3054,12 +3068,11 @@ class SupplierInvoiceLine extends CommonObjectLine $sql.= ", ".price2num($this->multicurrency_total_ttc); $sql.= ')'; - dol_syslog(get_class($this)."::insert", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); - $this->rowid=$this->id; + $this->rowid=$this->id; // backward compatibility if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e26f6faf8b3..2d2d203530a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1097,6 +1097,7 @@ if (empty($reshook)) $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); $date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); $date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); + $prod_entry_mode = GETPOST('prod_entry_mode'); if ($prod_entry_mode == 'free') { @@ -1211,7 +1212,7 @@ if (empty($reshook)) if(!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) { $desc = $productsupplier->desc_supplier; } else $desc = $productsupplier->description; - + if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $type = $productsupplier->type; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 96898ae270e..e608cb3b8da 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -33,9 +33,9 @@ class Loan extends CommonObject * @var string ID to identify managed object */ public $element='loan'; - + public $table='loan'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index dff061be5ef..5ca9a288721 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -17,8 +17,8 @@ /** * \file htdocs/loan/class/loanschedule.class.php - * \ingroup facture - * \brief File of class to manage schedule of loans + * \ingroup loan + * \brief File of class to manage schedule of loans */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -33,11 +33,11 @@ class LoanSchedule extends CommonObject * @var string ID to identify managed object */ public $element='loan_schedule'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='loan_schedule'; + public $table_element='loan_schedule'; var $fk_loan; var $datec=''; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 2190bf3265c..32b4080187f 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -34,11 +34,11 @@ class PaymentLoan extends CommonObject * @var string ID to identify managed object */ public $element='payment_loan'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='payment_loan'; + public $table_element='payment_loan'; var $fk_loan; var $datec=''; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index c9e582d4aae..ae9578db9b7 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -38,12 +38,12 @@ class Opensurveysondage extends CommonObject * @var string ID to identify managed object */ public $element='opensurvey_sondage'; - + /** * @var string Name of table without prefix where object is stored */ - public $table_element='opensurvey_sondage'; - + public $table_element='opensurvey_sondage'; + public $picto = 'opensurvey'; public $id_sondage; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 264ac58616d..0fc3c50efbd 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -33,8 +33,8 @@ class Productbatch extends CommonObject /** * @var string ID to identify managed object */ - public $element='productbatch'; - + public $element='productbatch'; + private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored var $tms=''; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 64b4f8a00a8..bb3782be0bb 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -31,13 +31,13 @@ class Productcustomerprice extends CommonObject /** * @var string ID to identify managed object */ - public $element = 'product_customer_price'; - + public $element = 'product_customer_price'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'product_customer_price'; - + public $table_element = 'product_customer_price'; + var $entity; var $datec = ''; var $tms = ''; @@ -964,7 +964,7 @@ class PriceByCustomerLine * @var int ID */ public $id; - + var $entity; var $datec = ''; var $tms = ''; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index bc5621e6eb3..3b9365d0850 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -34,12 +34,12 @@ class Propalmergepdfproduct extends CommonObject /** * @var string ID to identify managed object */ - public $element='propal_merge_pdf_product'; - + public $element='propal_merge_pdf_product'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element='propal_merge_pdf_product'; + public $table_element='propal_merge_pdf_product'; var $fk_product; var $file_name; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 50d45c54e2a..81be3d3d893 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -36,13 +36,13 @@ class Project extends CommonObject /** * @var string ID to identify managed object */ - public $element = 'project'; - + public $element = 'project'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'projet'; - + public $table_element = 'projet'; + public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -734,10 +734,10 @@ class Project extends CommonObject return -1; } } - + /** * Delete tasks with no children first, then task with children recursively - * + * * @param User $user User * @return int <0 if KO, 1 if OK */ @@ -765,7 +765,7 @@ class Project extends CommonObject { if (count($this->lines)) $this->deleteTasks($this->lines); } - + return 1; } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 63b56a2d0b2..9404bbc5aaa 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -34,24 +34,24 @@ class Task extends CommonObject /** * @var string ID to identify managed object */ - public $element='project_task'; - + public $element='project_task'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element='projet_task'; - + public $table_element='projet_task'; + public $fk_element='fk_task'; public $picto = 'task'; protected $childtables=array('projet_task_time'); // To test if we can delete object - var $fk_task_parent; - - /** - * @var string proper name for given parameter + public $fk_task_parent; + + /** + * @var string Label of task */ public $label; - + var $description; var $duration_effective; // total of time spent on this task var $planned_workload; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index b855a544cfa..de6666701d0 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -19,7 +19,6 @@ * \file resource/class/resource.class.php * \ingroup resource * \brief Class file for resource object - */ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; @@ -33,13 +32,13 @@ class Dolresource extends CommonObject /** * @var string ID to identify managed object */ - public $element='dolresource'; - + public $element='dolresource'; + /** * @var string Name of table without prefix where object is stored */ - public $table_element='resource'; - + public $table_element='resource'; + public $picto = 'resource'; public $resource_id; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 8b211a66f64..3743ec6c0d0 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -52,7 +52,7 @@ class Ticket extends CommonObject /** * @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ - public $ismultientitymanaged = 0; + public $ismultientitymanaged = 1; /** * @var int Does ticketcore support extrafields ? 0=No, 1=Yes diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index cf5f8dc122b..e006759ed51 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -36,26 +36,26 @@ class Ticketlogs// extends CommonObject * @var DoliDB Database handler. */ public $db; - + /** - * @var string Error code (or message) - */ - public $error; - + * @var string Error code (or message) + */ + public $error; + /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); - + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** - * @var string ID to identify managed object - */ - public $element = 'ticketlogs'; - + * @var string ID to identify managed object + */ + public $element = 'ticketlogs'; + /** - * @var string Name of table without prefix where object is stored - */ - public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored public $id;