diff --git a/.tx/config b/.tx/config index 010227f6e61..02ec4bc8b99 100644 --- a/.tx/config +++ b/.tx/config @@ -224,6 +224,18 @@ source_file = htdocs/langs/en_US/members.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.members] +file_filter = htdocs/langs//modulebuilder.lang +source_file = htdocs/langs/en_US/modulebuilder.lang +source_lang = en_US +type = MOZILLAPROPERTIES + +[dolibarr.members] +file_filter = htdocs/langs//multicurrency.lang +source_file = htdocs/langs/en_US/multicurrency.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.oauth] file_filter = htdocs/langs//oauth.lang source_file = htdocs/langs/en_US/oauth.lang @@ -350,18 +362,18 @@ source_file = htdocs/langs/en_US/users.lang source_lang = en_US type = MOZILLAPROPERTIES -[dolibarr.withdrawals] -file_filter = htdocs/langs//withdrawals.lang -source_file = htdocs/langs/en_US/withdrawals.lang -source_lang = en_US -type = MOZILLAPROPERTIES - [dolibarr.website] file_filter = htdocs/langs//website.lang source_file = htdocs/langs/en_US/website.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.withdrawals] +file_filter = htdocs/langs//withdrawals.lang +source_file = htdocs/langs/en_US/withdrawals.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.workflow] file_filter = htdocs/langs//workflow.lang source_file = htdocs/langs/en_US/workflow.lang diff --git a/build/debian/README.howto b/build/debian/README.howto index 399c4f07a1f..c94309ec2ef 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -152,7 +152,7 @@ tag 729538 -moreinfo -##### Testing a package into unstable env +##### Testing a package into a chroot environment Check you have a mysql server available from another interface than "localhost". Set line in /etc/mysql/my.cnf if required and restart mysql @@ -160,9 +160,11 @@ Set line in /etc/mysql/my.cnf if required and restart mysql [mysqld] bind-address = * -Create a chroot called "unstable-amd64-sbuild". +Create a chroot called "jessie" or "unstable". Chroot env is stored into /srv/chroot directory. > sudo sbuild-createchroot --keyring=unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian +or +> sudo sbuild-createchroot jessie /srv/chroot/jessie http://ftp.uk.debian.org/debian Pour lister les env chroot > schroot -l @@ -170,8 +172,9 @@ or > ls /srv/chroot Puis pour se connecter et préparer l'environnement -> schroot -c name_of_chroot +> schroot -c name_of_chroot (exemple schroot -c unstable-amd64-sbuild) > cat /etc/debian_chroot to check which debian branch we are into +> apt-get install vi dialog > vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok) > apt-get update > apt-get upgrade @@ -401,6 +404,7 @@ Note that package 3.5.7 contains not only fixed for bugs reported to debian. It so it is a better solution to validate this maintenance release than applying a patch of the only CVE-2015-3935. After discussion with ..., it appears that security holes are enough to request this unblock request." + Use this to request an full update of a stable package reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls @@ -431,7 +435,7 @@ Use this to ask to apply patches on a stable version. reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls Choose package "release.debian.org" -Then usertag "jessie-pu" +Then usertag "jessie-pu" (if tags is not available in list, choose another one, and change it later into email content text) Then name of package "dolibarr" Fill message, for example: "Please unblock package dolibarr diff --git a/htdocs/accountancy/admin/journals.php b/htdocs/accountancy/admin/journals.php deleted file mode 100644 index 677f2a743e5..00000000000 --- a/htdocs/accountancy/admin/journals.php +++ /dev/null @@ -1,168 +0,0 @@ - - * - * 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/accountancy/admin/journals.php - * \ingroup Advanced accountancy - * \brief Setup page to configure journals - */ -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; - -$action = GETPOST('action'); - -// Load variable for pagination -$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if ($page == -1) { $page = 0; } -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (! $sortfield) $sortfield="j.rowid"; // Set here default search field -if (! $sortorder) $sortorder="ASC"; - -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); - -// Security check -if ($user->societe_id > 0) - accessforbidden(); -if (! $user->rights->accounting->fiscalyear) // If we can read accounting records, we shoul be able to see fiscal year. - accessforbidden(); - -$error = 0; - -// List of status -/* -static $tmptype2label = array ( - '0' => 'AccountingJournalTypeVariousOperation', - '1' => 'AccountingJournalTypeSale', - '2' => 'AccountingJournalTypePurchase', - '3' => 'AccountingJournalTypeBank', - '9' => 'AccountingJournalTypeHasNew' -); -$type2label = array ( - '' -); -foreach ( $tmptype2label as $key => $val ) - $type2label[$key] = $langs->trans($val); -*/ - -$errors = array (); - -$object = new AccountingJournal($db); - - -/* - * Actions - */ - - - -/* - * View - */ -$title = $langs->trans('AccountingJournals'); -$helpurl = ""; -llxHeader('', $title, $helpurl); - -$max = 100; -$form = new Form($db); - -$linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup'); - -$head = admin_accounting_prepare_head(null); - -dol_fiche_head($head, 'journal', $langs->trans("Configuration"), -1, 'cron'); - -$sql = "SELECT j.rowid, j.code, j.label, j.nature, j.active"; -$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_journal as j"; -// $sql .= " WHERE j.entity = " . $conf->entity; -$sql.=$db->order($sortfield,$sortorder); - -// Count total nb of records -$nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); -} - -$sql.= $db->plimit($limit+1, $offset); - -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); - - $i = 0; - - // $title = $langs->trans('AccountingJournals'); - // print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 1); - - // Load attribute_label - print ''; - print ''; - // print ''; - print ''; - print ''; - print ''; - print ''; - - if ($num) { - $accountingjournalstatic = new AccountingJournal($db); - - while ( $i < $num && $i < $max ) { - $obj = $db->fetch_object($result); - $accountingjournalstatic->id = $obj->rowid; - print ''; - print ''; - print ''; - print ''; - print ''; - $i ++; - } - } else { - print ''; - } - print '
' . $langs->trans("Ref") . '' . $langs->trans("Code") . '' . $langs->trans("Label") . '' . $langs->trans("Nature") . '
' . img_object($langs->trans("ShowJournal"), "technic") . ' ' . $obj->code . '' . $obj->label . '' . $accountingjournalstatic->LibType($obj->nature, 0) . '
' . $langs->trans("None") . '
'; -} else { - dol_print_error($db); -} - -dol_fiche_end(); - -// Buttons -print '
'; -if (! empty($user->rights->accounting->fiscalyear)) -{ - print '' . $langs->trans("NewAccountingJournal") . ''; -} -else -{ - print '' . $langs->trans("NewAccountingJournal") . ''; -} -print '
'; - -llxFooter(); -$db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/admin/journals_card.php b/htdocs/accountancy/admin/journals_card.php deleted file mode 100644 index 9e04d75ce9f..00000000000 --- a/htdocs/accountancy/admin/journals_card.php +++ /dev/null @@ -1,294 +0,0 @@ - - * - * 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/accountancy/admin/journals_card.php - * \ingroup Advanced accountancy - * \brief Page to show an accounting journal - */ -require '../../main.inc.php'; - -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; - -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); - -// Security check -if ($user->societe_id > 0) - accessforbidden(); -if (empty($user->rights->accounting->fiscalyear)) - accessforbidden(); - -$error = 0; - -$action = GETPOST('action', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); - -// List of status -static $tmptype2label = array ( - '0' => 'AccountingJournalTypeVariousOperation', - '1' => 'AccountingJournalTypeSale', - '2' => 'AccountingJournalTypePurchase', - '3' => 'AccountingJournalTypeBank', - '9' => 'AccountingJournalTypeHasNew' -); -$type2label = array ( - '' -); -foreach ( $tmptype2label as $key => $val ) - $type2label[$key] = $langs->trans($val); - -$object = new AccountingJournal($db); - -/* - * Actions - */ - -if ($action == 'confirm_delete' && $confirm == "yes") { - $result = $object->delete($id); - if ($result >= 0) { - header("Location: journals.php"); - exit(); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } -} - -else if ($action == 'add') { - if (! GETPOST('cancel', 'alpha')) { - $error = 0; - - $object->code = GETPOST('code', 'alpha'); - $object->label = GETPOST('label', 'alpha'); - $object->nature = GETPOST('nature', 'int'); - - if (empty($object->code)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Code")), null, 'errors'); - $error ++; - } - if (empty($object->label)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); - $error ++; - } - - if (! $error) { - $db->begin(); - - $id = $object->create($user); - - if ($id > 0) { - $db->commit(); - - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); - exit(); - } else { - $db->rollback(); - - setEventMessages($object->error, $object->errors, 'errors'); - $action = 'create'; - } - } else { - $action = 'create'; - } - } else { - header("Location: ./journals.php"); - exit(); - } -} - -// Update record -else if ($action == 'update') { - if (! GETPOST('cancel', 'alpha')) { - $result = $object->fetch($id); - - $object->code = GETPOST('code', 'alpha'); - $object->label = GETPOST('label', 'alpha'); - $object->nature = GETPOST('nature', 'int'); - - if (empty($object->code)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Code")), null, 'errors'); - $error ++; - } - if (empty($object->label)) { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); - $error ++; - } - - $result = $object->update($user); - - if ($result > 0) { - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); - exit(); - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } else { - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); - exit(); - } -} - - - -/* - * View - */ - -$title = $langs->trans("Journal") . " - " . $langs->trans("Card"); -$helpurl = ""; -llxHeader("",$title,$helpurl); - -$form = new Form($db); - -if ($action == 'create') -{ - print load_fiche_titre($langs->trans("NewAccountingJournal")); - - print '
'; - print ''; - print ''; - - dol_fiche_head(); - - print ''; - - // Code - print ''; - - - // Label - print ''; - - // Nature - print ''; - print ''; - print ''; - - print '
' . $langs->trans("Code") . '
' . $langs->trans("Label") . '
' . $langs->trans("Type") . ''; - print $form->selectarray('nature', $type2label, GETPOST('nature')); - print '
'; - - dol_fiche_end(); - - print '
'; - print ''; - print '     '; - print ''; - print '
'; - - print '
'; -} else if ($id) { - $result = $object->fetch($id); - if ($result > 0) { - $head = accounting_journal_prepare_head($object); - - if ($action == 'edit') { - dol_fiche_head($head, 'card', $langs->trans("AccountingJournal"), 0, 'cron'); - - print '
' . "\n"; - print ''; - print ''; - print ''; - - print ''; - - // Code - print ""; - print ''; - - // Label - print ''; - - // Nature - print ''; - - print '
' . $langs->trans("Code") . ''; - print ''; - print '
' . $langs->trans("Label") . ''; - print ''; - print '
' . $langs->trans("Type") . ''; - print $form->selectarray('nature', $type2label, $object->nature); - print '
'; - - print '
'; - print ''; - print '     '; - print ''; - print '
'; - - print '
'; - - dol_fiche_end(); - } else { - /* - * Confirm delete - */ - if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete"); - } - - dol_fiche_head($head, 'card', $langs->trans("AccountingJournal"), 0, 'cron'); - - print ''; - - $linkback = '' . $langs->trans("BackToList") . ''; - - // Ref - print ''; - - // Label - print '"; - - // Nature - print ''; - - print "
' . $langs->trans("Code") . ''; - print $object->code; - print ''; - print $linkback; - print '
'; - print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); - print ''; - print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32'); - print "
' . $langs->trans("Type") . '' . $object->getLibType(0) . '
"; - - dol_fiche_end(); - - if (! empty($user->rights->accounting->fiscalyear)) - { - /* - * Barre d'actions - */ - print '
'; - - print '' . $langs->trans('Modify') . ''; - - print '' . $langs->trans('Delete') . ''; - - print '
'; - } - } - } else { - dol_print_error($db); - } -} - -llxFooter(); -$db->close(); diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php new file mode 100644 index 00000000000..0b13bfc7d4d --- /dev/null +++ b/htdocs/accountancy/admin/journals_list.php @@ -0,0 +1,752 @@ + + * + * 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/accountancy/admin/journals_list.php + * \ingroup Advanced accountancy + * \brief Setup page to configure journals + */ +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; + +$langs->load("admin"); +$langs->load("compta"); +$langs->load("accountancy"); + +$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; +$confirm=GETPOST('confirm','alpha'); +$id=GETPOST('id','int'); +$rowid=GETPOST('rowid','alpha'); + +// Security access +if (! empty($user->rights->accountancy->chartofaccount)) +{ + accessforbidden(); +} + +$acts[0] = "activate"; +$acts[1] = "disable"; +$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); + +$listoffset=GETPOST('listoffset'); +$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; +$active = 1; + +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0 ; } +$offset = $listlimit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (empty($sortfield)) $sortfield='code'; +if (empty($sortorder)) $sortorder='ASC'; + +$error = 0; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('admin')); + +// This page is a generic page to edit dictionaries +// 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(35); + +// Name of SQL tables of dictionaries +$tabname=array(); +$tabname[35]= MAIN_DB_PREFIX."accounting_journal"; + +// Dictionary labels +$tablib=array(); +$tablib[35]= "DictionaryAccountancyJournal"; + +// Requests to extract data +$tabsql=array(); +$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a"; + +// Criteria to sort dictionaries +$tabsqlsort=array(); +$tabsqlsort[35]="code ASC"; + +// Nom des champs en resultat de select pour affichage du dictionnaire +$tabfield=array(); +$tabfield[35]= "code,label,nature"; + +// Nom des champs d'edition pour modification d'un enregistrement +$tabfieldvalue=array(); +$tabfieldvalue[35]= "code,label,nature"; + +// Nom des champs dans la table pour insertion d'un enregistrement +$tabfieldinsert=array(); +$tabfieldinsert[35]= "code,label,nature"; + +// Nom du rowid si le champ n'est pas de type autoincrement +// Example: "" if id field is "rowid" and has autoincrement on +// "nameoffield" if id field is not "rowid" or has not autoincrement on +$tabrowid=array(); +$tabrowid[35]= ""; + +// Condition to show dictionary in setup page +$tabcond=array(); +$tabcond[35]= ! empty($conf->accounting->enabled); + +// List of help for fields +$tabhelp=array(); +$tabhelp[35] = array('code'=>$langs->trans("EnterAnyCode")); + +// List of check for fields (NOT USED YET) +$tabfieldcheck=array(); +$tabfieldcheck[35] = 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); + + +// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact") +$elementList = array(); + // Must match ids defined into eldy.lib.php + $sourceList = array( + '1' => $langs->trans('AccountingJournalType1'), + '2' => $langs->trans('AccountingJournalType2'), + '3' => $langs->trans('AccountingJournalType3'), + '4' => $langs->trans('AccountingJournalType4'), + '9' => $langs->trans('AccountingJournalType9') + ); + +/* + * Actions + */ + +if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x')) +{ + $search_country_id = ''; +} + +// Actions add or modify an entry into a dictionary +if (GETPOST('actionadd') || GETPOST('actionmodify')) +{ + $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); + $listfieldinsert=explode(',',$tabfieldinsert[$id]); + $listfieldmodify=explode(',',$tabfieldinsert[$id]); + $listfieldvalue=explode(',',$tabfieldvalue[$id]); + + // Check that all fields are filled + $ok=1; + foreach ($listfield as $f => $value) + { + if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; + if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; + if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature'; + } + // Other checks + if (isset($_POST["code"])) + { + if ($_POST["code"]=='0') + { + $ok=0; + setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); + } + /*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base + { + $ok = 0; + $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; + }*/ + } + + // Clean some parameters + if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null + if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null + if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null + + // Si verif ok et action add, on ajoute la ligne + if ($ok && GETPOST('actionadd')) + { + if ($tabrowid[$id]) + { + // Recupere id libre pour insertion + $newid=0; + $sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id]; + $result = $db->query($sql); + if ($result) + { + $obj = $db->fetch_object($result); + $newid=($obj->newid + 1); + + } else { + dol_print_error($db); + } + } + + // Add new entry + $sql = "INSERT INTO ".$tabname[$id]." ("; + // List of fields + if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + $sql.= $tabrowid[$id].","; + $sql.= $tabfieldinsert[$id]; + $sql.=",active)"; + $sql.= " VALUES("; + + // List of values + if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + $sql.= $newid.","; + $i=0; + foreach ($listfieldinsert as $f => $value) + { + if ($value == 'entity') { + $_POST[$listfieldvalue[$i]] = $conf->entity; + } + if ($i) $sql.=","; + if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + $i++; + } + $sql.=",1)"; + + dol_syslog("actionadd", LOG_DEBUG); + $result = $db->query($sql); + if ($result) // Add is ok + { + setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); + $_POST=array('id'=>$id); // Clean $_POST array, we keep only + } + else + { + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors'); + } + else { + dol_print_error($db); + } + } + } + + // Si verif ok et action modify, on modifie la ligne + if ($ok && GETPOST('actionmodify')) + { + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + // Modify entry + $sql = "UPDATE ".$tabname[$id]." SET "; + // Modifie valeur des champs + if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + { + $sql.= $tabrowid[$id]."="; + $sql.= "'".$db->escape($rowid)."', "; + } + $i = 0; + foreach ($listfieldmodify as $field) + { + if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + } + else if ($field == 'entity') { + $_POST[$listfieldvalue[$i]] = $conf->entity; + } + if ($i) $sql.=","; + $sql.= $field."="; + if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; + $i++; + } + $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; + + dol_syslog("actionmodify", LOG_DEBUG); + //print $sql; + $resql = $db->query($sql); + if (! $resql) + { + setEventMessages($db->error(), null, 'errors'); + } + } + //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition +} + +if (GETPOST('actioncancel')) +{ + //$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition +} + +if ($action == 'confirm_delete' && $confirm == 'yes') // delete +{ + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'"; + + dol_syslog("delete", LOG_DEBUG); + $result = $db->query($sql); + if (! $result) + { + if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') + { + setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors'); + } + else + { + dol_print_error($db); + } + } +} + +// activate +if ($action == $acts[0]) +{ + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + if ($rowid) { + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'"; + } + elseif ($_GET["code"]) { + $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$_GET["code"]."'"; + } + + $result = $db->query($sql); + if (!$result) + { + dol_print_error($db); + } +} + +// disable +if ($action == $acts[1]) +{ + if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; } + else { $rowidcol="rowid"; } + + if ($rowid) { + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'"; + } + elseif ($_GET["code"]) { + $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$_GET["code"]."'"; + } + + $result = $db->query($sql); + if (!$result) + { + dol_print_error($db); + } +} + +/* + * View + */ + +$form = new Form($db); +$formadmin=new FormAdmin($db); + +llxHeader(); + +$titre=$langs->trans("DictionarySetup"); +$linkback=''; +if ($id) +{ + $titre.=' - '.$langs->trans($tablib[$id]); + $titlepicto='title_accountancy'; +} + +print load_fiche_titre($titre,$linkback,$titlepicto); + +if (empty($id)) +{ + print $langs->trans("DictionaryDesc"); + print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; +} +print "
\n"; + + +// Confirmation de la suppression de la ligne +if ($action == 'delete') +{ + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); +} +//var_dump($elementList); + +/* + * Show a dictionary + */ +if ($id) +{ + // Complete requete recherche valeurs avec critere de tri + $sql=$tabsql[$id]; + + if ($search_country_id > 0) + { + if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; + else $sql.=" WHERE "; + $sql.= " c.rowid = ".$search_country_id; + } + + if ($sortfield) + { + // If sort order is "country", we use country_code instead + if ($sortfield == 'country') $sortfield='country_code'; + $sql.= " ORDER BY ".$sortfield; + if ($sortorder) + { + $sql.=" ".strtoupper($sortorder); + } + $sql.=", "; + // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); + } + else { + $sql.=" ORDER BY "; + } + $sql.=$tabsqlsort[$id]; + $sql.=$db->plimit($listlimit+1,$offset); + //print $sql; + + $fieldlist=explode(',',$tabfield[$id]); + + print '
'; + print ''; + print ''; + + print ''; + + // Form to add a new line + if ($tabname[$id]) + { + $alabelisused=0; + $var=false; + + $fieldlist=explode(',',$tabfield[$id]); + + // Line for title + print ''; + foreach ($fieldlist as $field => $value) + { + // Determine le nom du champ par rapport aux noms possibles + // dans les dictionnaires de donnees + $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut + $valuetoshow=$langs->trans($valuetoshow); // try to translate + $align="left"; + if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') + { + $valuetoshow=$langs->trans("Label"); + } + if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); } + + if ($valuetoshow != '') + { + print ''; + } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + + // Line to enter new values + print ''; + + $obj = new stdClass(); + // If data was already input, we define them in obj to populate input fields. + if (GETPOST('actionadd')) + { + foreach ($fieldlist as $key=>$val) + { + if (GETPOST($val) != '') + $obj->$val=GETPOST($val); + } + } + + $tmpaction = 'create'; + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$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 (empty($reshook)) + { + fieldList($fieldlist,$obj,$tabname[$id],'add'); + } + + print ''; + print ""; + + print ''; // Keep   to have a line with enough height + } + + + + // List of available record in database + dol_syslog("htdocs/admin/dict", LOG_DEBUG); + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + $var=true; + + $param = '&id='.$id; + if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id; + $paramwithsearch = $param; + if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder; + if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield; + if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha'); + + // There is several pages + if ($num > $listlimit) + { + print ''; + } + + // Title of lines + print ''; + foreach ($fieldlist as $field => $value) + { + // Determine le nom du champ par rapport aux noms possibles + // dans les dictionnaires de donnees + $showfield=1; // By defaut + $align="left"; + $sortable=1; + $valuetoshow=''; + /* + $tmparray=getLabelOfField($fieldlist[$field]); + $showfield=$tmp['showfield']; + $valuetoshow=$tmp['valuetoshow']; + $align=$tmp['align']; + $sortable=$tmp['sortable']; + */ + $valuetoshow=ucfirst($fieldlist[$field]); // By defaut + $valuetoshow=$langs->trans($valuetoshow); // try to translate + if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } + if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); } + + // Affiche nom du champ + if ($showfield) + { + print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder); + } + } + print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder); + print getTitleFieldOfList(''); + print getTitleFieldOfList(''); + print getTitleFieldOfList(''); + print ''; + + // Title line with search boxes + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($num) + { + // Lines with values + while ($i < $num) + { + $obj = $db->fetch_object($resql); + //print_r($obj); + print ''; + if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) + { + $tmpaction='edit'; + $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $error=$hookmanager->error; $errors=$hookmanager->errors; + + // Show fields + if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); + + print ''; + } + else + { + $tmpaction = 'view'; + $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + + $error=$hookmanager->error; $errors=$hookmanager->errors; + + if (empty($reshook)) + { + foreach ($fieldlist as $field => $value) + { + + $showfield=1; + $align="left"; + $valuetoshow=$obj->{$fieldlist[$field]}; + if ($valuetoshow=='all') { + $valuetoshow=$langs->trans('All'); + } + else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { + $langs->load("accountancy"); + $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); + $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]}); + } + + $class='tddict'; + // Show value for field + if ($showfield) print ''; + } + } + + // Can an entry be erased or disabled ? + $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default + if (isset($obj->code) && $id != 10) + { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } + else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } + else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } + } + + $canbemodified=$iserasable; + + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); + if ($param) $url .= '&'.$param; + $url.='&'; + + // Active + print '"; + + // Modify link + if ($canbemodified) print ''; + else print ''; + + // Delete link + if ($iserasable) + { + print ''; + } + else print ''; + + print ''; + + print ''; + } + + print "\n"; + $i++; + } + } + } + else { + dol_print_error($db); + } + + print '
'; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; + else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + else print $valuetoshow; + print ''; + print ''; + print '
'; + print ''; + print '
 
'; + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print '
'; + if ($filterfound) + { + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + } + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'.$valuetoshow.''; + if ($canbedisabled) print ''.$actl[$obj->active].''; + else + { + if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); + else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); + else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); + else print $langs->trans("AlwaysActive"); + } + print "'.img_edit().' '; + if ($user->admin) print ''.img_delete().''; + //else print ''.img_delete().''; // Some dictionnary can be edited by other profile than admin + print ' 
'; + + print '
'; +} + +print '
'; + + +llxFooter(); +$db->close(); + + +/** + * 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 + * @param string $tabname Name of SQL table + * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered + * @return void + */ +function fieldList($fieldlist, $obj='', $tabname='', $context='') +{ + global $conf,$langs,$db; + global $form, $mysoc; + global $region_id; + global $elementList,$sourceList,$localtax_typeList; + global $bc; + + $formadmin = new FormAdmin($db); + $formcompany = new FormCompany($db); + + foreach ($fieldlist as $field => $value) + { + if ($fieldlist[$field] == 'nature') + { + print ''; + print $form->selectarray('nature', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print ''; + } + elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { + print ''; + } + else + { + print ''; + $size=''; $class=''; + if ($fieldlist[$field]=='code') $class='maxwidth100'; + if ($fieldlist[$field]=='label') $class='quatrevingtpercent'; + if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" '; + print ''; + print ''; + } + } +} \ No newline at end of file diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 524326e320c..1af9e5d1a6b 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -47,6 +47,7 @@ class AccountancyExport public static $EXPORT_TYPE_QUADRATUS = 6; public static $EXPORT_TYPE_EBP = 7; public static $EXPORT_TYPE_COGILOG = 8; + public static $EXPORT_TYPE_AGIRIS = 9; /** * @@ -96,6 +97,7 @@ class AccountancyExport self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'), self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'), self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'), + self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris') ); } @@ -145,6 +147,9 @@ class AccountancyExport case self::$EXPORT_TYPE_COGILOG : $this->exportCogilog($TData); break; + case self::$EXPORT_TYPE_AGIRIS : + $this->exportAgiris($TData); + break; default: $this->errors[] = $langs->trans('accountancy_error_modelnotfound'); break; @@ -382,7 +387,7 @@ class AccountancyExport /** - * Export format : Normal + * Export format : EBP * * @param array $objectLines data * @@ -412,6 +417,47 @@ class AccountancyExport } + /** + * Export format : Agiris + * + * @param array $objectLines data + * + * @return void + */ + public function exportAgiris($objectLines) { + + $this->separator = ';'; + + foreach ( $objectLines as $line ) { + + $date = dol_print_date($line->doc_date, '%d%m%Y'); + + print $line->id . $this->separator; + print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator; + print $date . $this->separator; + print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator; + + if (empty($line->code_tiers)) { + print length_accountg($line->numero_compte) . $this->separator; + } else { + if (substr($line->numero_compte, 0, 1) == 'C' || substr($line->numero_compte, 0, 1) == '9') { + print '411' . substr(str_replace(" ", "", $line->code_tiers), 0, 5) . $this->separator; + } + if (substr($line->numero_compte, 0, 1) == 'F' || substr($line->numero_compte, 0, 1) == '0') { + print '401' . substr(str_replace(" ", "", $line->code_tiers), 0, 5) . $this->separator; + } + } + + print length_accounta($line->code_tiers) . $this->separator; + print price($line->debit) . $this->separator; + print price($line->credit) . $this->separator; + print price($line->montant).$this->separator; + print $line->sens.$this->separator; + print $line->code_journal . $this->separator; + print $this->end_line; + } + } + /** * diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 4174ee7809f..8bf7dfe0c44 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -364,28 +364,63 @@ class AccountingAccount extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param int $withlabel 0=No label, 1=Include label of account + * @param int $nourl 1=Disable url + * @param string $moretitle Add more text to title tooltip + * @param int $notooltip 1=Disable tooltip + * @return string String with URL */ - function getNomUrl($withpicto = 0) { - global $langs; + function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0) + { + global $langs, $conf, $user; + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result = ''; - $link = ''; - $linkend = ''; + $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; $picto = 'billr'; + $label=''; - $label = $langs->trans("Show") . ': ' . $this->account_number . ' - ' . $this->label; + $label = '' . $langs->trans("ShowAccountingAccount") . ''; + if (! empty($this->account_number)) + $label .= '
'.$langs->trans('AccountAccounting') . ': ' . length_accountg($this->account_number); + if (! empty($this->label)) + $label .= '
'.$langs->trans('Label') . ': ' . $this->label; + if ($moretitle) $label.=' - '.$moretitle; - if ($withpicto) - $result .= ($link . img_object($label, $picto) . $linkend); - if ($withpicto && $withpicto != 2) - $result .= ' '; - if ($withpicto != 2) - require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; - $result .= $link . length_accountg($this->account_number) . ' - ' . $this->label . $linkend; + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowAccoutingAccount"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; + } + + $linkstart=''; + $linkend=''; + + if ($nourl) + { + $linkstart = ''; + $linkclose = ''; + $linkend = ''; + } + + $label_link = length_accountg($this->account_number); + if ($withlabel) $label_link .= ' - ' . $this->label; + + if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend); + if ($withpicto && $withpicto != 2) $result .= ' '; + if ($withpicto != 2) $result.=$linkstart . $label_link . $linkend; return $result; } diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index d7cc61d6418..064f56bddd6 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -82,208 +82,6 @@ class AccountingJournal extends CommonObject } } - /** - * Insert journal in database - * - * @param User $user Use making action - * @param int $notrigger Disable triggers - * @return int <0 if KO, >0 if OK - */ - function create($user, $notrigger = 0) - { - global $conf; - $error = 0; - $now = dol_now(); - - // Clean parameters - if (isset($this->code)) - $this->code = trim($this->code); - if (isset($this->label)) - $this->label = trim($this->label); - - // Check parameters - if (empty($this->nature) || $this->nature == '-1') - { - $this->nature = '0'; - } - - // Insert request - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_journal("; - $sql .= "code"; - $sql .= ", label"; - $sql .= ", nature"; - $sql .= ", active"; - $sql .= ") VALUES ("; - $sql .= " " . (empty($this->code) ? 'NULL' : "'" . $this->db->escape($this->code) . "'"); - $sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'"); - $sql .= ", " . (empty($this->nature) ? '0' : "'" . $this->db->escape($this->nature) . "'"); - $sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active)); - $sql .= ")"; - - $this->db->begin(); - - dol_syslog(get_class($this) . "::create sql=" . $sql, LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { - $error ++; - $this->errors[] = "Error " . $this->db->lasterror(); - } - - if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "accounting_journal"); - - // if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - // // Call triggers - // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - // $interface=new Interfaces($this->db); - // $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); - // if ($result < 0) { $error++; $this->errors=$interface->errors; } - // // End call triggers - // } - } - - // Commit or rollback - if ($error) { - foreach ( $this->errors as $errmsg ) { - dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR); - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); - } - $this->db->rollback(); - return - 1 * $error; - } else { - $this->db->commit(); - return $this->id; - } - } - - /** - * Update record - * - * @param User $user Use making update - * @return int <0 if KO, >0 if OK - */ - function update($user) - { - // Check parameters - if (empty($this->nature) || $this->nature == '-1') - { - $this->nature = '0'; - } - - $this->db->begin(); - - $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_journal "; - $sql .= " SET code = " . ($this->code ? "'" . $this->db->escape($this->code) . "'" : "null"); - $sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null"); - $sql .= " , nature = " . ($this->nature ? "'" . $this->db->escape($this->nature) . "'" : "0"); - $sql .= " , active = '" . $this->active . "'"; - $sql .= " WHERE rowid = " . $this->id; - - dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return - 1; - } - } - - /** - * Check usage of accounting journal - * - * @return int <0 if KO, >0 if OK - */ - function checkUsage() { - global $langs; - - $sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet"; - $sql .= " WHERE fk_code_ventilation=" . $this->id . ")"; - $sql .= "UNION"; - $sql .= "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facture_fourn_det"; - $sql .= " WHERE fk_code_ventilation=" . $this->id . ")"; - - dol_syslog(get_class($this) . "::checkUsage sql=" . $sql, LOG_DEBUG); - $resql = $this->db->query($sql); - - if ($resql) { - $num = $this->db->num_rows($resql); - if ($num > 0) { - $this->error = $langs->trans('ErrorAccountingJournalIsAlreadyUse'); - return 0; - } else { - return 1; - } - } else { - $this->error = $this->db->lasterror(); - return - 1; - } - } - - /** - * Delete object in database - * - * @param User $user User that deletes - * @param int $notrigger 0=triggers after, 1=disable triggers - * @return int <0 if KO, >0 if OK - */ - function delete($user, $notrigger = 0) { - $error = 0; - - $result = $this->checkUsage(); - - if ($result > 0) { - - $this->db->begin(); - - // if (! $error) { - // if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - // // Call triggers - // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - // $interface=new Interfaces($this->db); - // $result=$interface->run_triggers('ACCOUNTANCY_ACCOUNT_DELETE',$this,$user,$langs,$conf); - // if ($result < 0) { $error++; $this->errors=$interface->errors; } - // // End call triggers - // } - // } - - if (! $error) { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "accounting_journal"; - $sql .= " WHERE rowid=" . $this->id; - - dol_syslog(get_class($this) . "::delete sql=" . $sql); - $resql = $this->db->query($sql); - if (! $resql) { - $error ++; - $this->errors[] = "Error " . $this->db->lasterror(); - } - } - - // Commit or rollback - if ($error) { - foreach ( $this->errors as $errmsg ) { - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); - $this->error .= ($this->error ? ', ' . $errmsg : $errmsg); - } - $this->db->rollback(); - return - 1 * $error; - } else { - $this->db->commit(); - return 1; - } - } else { - return - 1; - } - } - /** * Return clicable name (with picto eventually) * @@ -311,64 +109,6 @@ class AccountingJournal extends CommonObject return $result; } - /** - * Deactivate journal - * - * @param int $id Id - * @return int <0 if KO, >0 if OK - */ - function journal_deactivate($id) { - $result = $this->checkUsage(); - - if ($result > 0) { - $this->db->begin(); - - $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_journal "; - $sql .= "SET active = '0'"; - $sql .= " WHERE rowid = " . $this->db->escape($id); - - dol_syslog(get_class($this) . "::deactivate sql=" . $sql, LOG_DEBUG); - $result = $this->db->query($sql); - - if ($result) { - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return - 1; - } - } else { - return - 1; - } - } - - /** - * Activate journal - * - * @param int $id Id - * @return int <0 if KO, >0 if OK - */ - function journal_activate($id) { - $this->db->begin(); - - $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_journal "; - $sql .= "SET active = '1'"; - $sql .= " WHERE rowid = " . $this->db->escape($id); - - dol_syslog(get_class($this) . "::activate sql=" . $sql, LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) { - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return - 1; - } - } - - /** * Retourne le libelle du statut d'un user (actif, inactif) * diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index ff9ca6fa1a3..c7caa5daac3 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -71,6 +71,10 @@ print "
\n"; // STEPS $step++; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''); +print "
\n"; +print "
\n"; +$step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''); print "
\n"; print "
\n"; @@ -148,24 +152,26 @@ print '
'; print "
\n"; $step = 0; +$langs->loadLangs(array('bills', 'trips')); + $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step)."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."
\n"; print "
\n"; $step++; -print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."
\n"; +print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."
\n"; print "
\n"; llxFooter(); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 7dc6f652c73..a68798869a2 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -695,7 +695,6 @@ if ($action == 'export_csv') { */ - /* * View */ @@ -749,7 +748,7 @@ if (empty($action) || $action == 'view') { /* * Show result array */ - print '

'; + print '
'; $i = 0; print ""; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 6488c6c4fd3..8e343bcbb08 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -477,7 +477,7 @@ if (empty($action) || $action == 'view') { /* * Show result array */ - print '

'; + print '
'; $i = 0; print "
"; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b16c71d2f7b..beb0c777e27 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -500,6 +500,7 @@ $form = new Form($db); } */ + if (empty($action) || $action == 'view') { llxHeader('', $langs->trans("SellsJournal")); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c5fc1c55793..22679ca697b 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -150,7 +150,6 @@ print $langs->trans("AgendaAutoActionDesc")."
\n"; print $langs->trans("OnlyActiveElementsAreShown").'
'; print "
\n"; -$var=true; print '
'; print ''; print ''; @@ -180,7 +179,7 @@ if (! empty($triggers)) print ''."\n"; } } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index f652829a80c..1d785e882fc 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -245,7 +245,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) clearstatcache(); - $var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/action/doc/"); @@ -263,10 +262,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) $classname = substr($file, 0, dol_strlen($file) -12); require_once $dir.'/'.$file; - $module = new $classname($db, new ActionComm($db)); + $module = new $classname($db, new ActionComm($db)); - - print "\n"; + print ''."\n"; print "\n"; @@ -338,8 +336,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print '
'.$langs->trans("ActionsEvents").''; $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; $value=$conf->global->$key; - print ''; + print ''; print '
"; print (empty($module->name)?$name:$module->name); print "

'; } -$var=true; - print '
'; print ''; @@ -380,7 +376,6 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) } // AGENDA_DEFAULT_FILTER_TYPE - print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").''."\n"; print ' '."\n"; @@ -389,7 +384,6 @@ $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AG print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS - print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").''."\n"; print ' '."\n"; @@ -398,7 +392,6 @@ $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_ print ''."\n"; // AGENDA_DEFAULT_VIEW - print ''."\n"; print ''.$langs->trans("AGENDA_DEFAULT_VIEW").''."\n"; print ' '."\n"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 98cecb2f44b..8ed1e3cd9ac 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -273,7 +273,6 @@ print "\n"; clearstatcache(); -$var = true; foreach ($dirmodels as $reldir) { foreach (array('', '/doc') as $valdir) { @@ -305,8 +304,7 @@ foreach ($dirmodels as $reldir) $modulequalified = 0; if ($modulequalified) { - $var = ! $var; - print ''; + print ''; print(empty($module->name) ? $name : $module->name); print "\n"; if (method_exists($module, 'info')) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 8c29fe67a1c..ef22d8ecb4a 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2011-2016 Philippe Grand + * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -545,7 +545,6 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").''; print "\n"; - $var=true; print ''; @@ -561,10 +560,9 @@ if ($action == 'edit' || $action == 'updateedit') print ''.$langs->trans("VATManagement").''.$langs->trans("Description").''; print ' '; print "\n"; - $var=true; - print ""; + print ""; print ''; print ""; print ""; @@ -573,7 +571,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; - print ""; + print ""; print '
'; print ""; print ""; @@ -595,10 +593,9 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''; print "\n"; - $var=true; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ''; print ""; @@ -620,7 +617,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; - print ""; + print ""; print '
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; print ""; @@ -639,11 +636,10 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''; print "\n"; - $var=true; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ''; print ""; @@ -662,7 +658,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; - print ""; + print ""; print '
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; print ""; @@ -696,7 +692,6 @@ else print '
'; print ''; - $var=true; print ''; print ''; print ''; - print ''; + print ''; print ''; if (!empty($conf->multicurrency->enabled)) print ''; print ''; @@ -3697,7 +3710,10 @@ abstract class CommonObject $this->tpl['description'] = ' '; } + // VAT Rate $this->tpl['vat_rate'] = vatrate($line->tva_tx, true); + if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')'; + $this->tpl['price'] = price($line->subprice); $this->tpl['multicurrency_price'] = price($line->multicurrency_subprice); $this->tpl['qty'] = (($line->info_bits & 2) != 2) ? $line->qty : ' '; @@ -4922,25 +4938,33 @@ abstract class CommonObject if(!empty($id)) $sql.= ' WHERE rowid = '.$id; else $sql.= ' WHERE ref = \''.$this->quote($ref).'\''; - + $res = $this->db->query($sql); - if($obj = $this->db->fetch_object($res)) + if ($res) { - $this->id = $id; - $this->set_vars_by_db($obj); - - $this->datec = $this->db->idate($obj->datec); - $this->tms = $this->db->idate($obj->tms); - - return $this->id; + if ($obj = $this->db->fetch_object($res)) + { + $this->id = $id; + $this->set_vars_by_db($obj); + + $this->datec = $this->db->idate($obj->datec); + $this->tms = $this->db->idate($obj->tms); + + return $this->id; + } + else + { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; + return -1; + } } else { - $this->error = $this->db->lasterror(); - $this->errors[] = $this->error; - return -1; + $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; + return -1; } - } /** diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 6bca5b7d5a4..28a287971a8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -358,8 +358,8 @@ class Conf $this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; $this->supplier_invoice=new stdClass(); $this->supplier_invoice->enabled=1; - $this->supplier_order->dir_output=$rootfordata."/fournisseur/facture"; - $this->supplier_order->dir_temp=$rootfordata."/fournisseur/facture/temp"; + $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; + $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; } } diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php index 021213594f7..1456fb991c2 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -106,14 +106,12 @@ class CoreObject extends CommonObject */ public function fetch($id, $loadChild = true) { - $res = $this->fetchCommon($id); if($res>0) { if ($loadChild) $this->fetchChild(); } return $res; - } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cab420fe888..6a503b40975 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -986,18 +986,23 @@ class Form } // mode 1 $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter; - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + $out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + $out.=''; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; else if ($hidelabel > 1) { if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"'; else $placeholder=' title="'.$langs->trans("RefOrLabel").'"'; if ($hidelabel == 2) { - print img_picto($langs->trans("Search"), 'search'); + $out.= img_picto($langs->trans("Search"), 'search'); } } - print 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + $out.= 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; if ($hidelabel == 3) { - print img_picto($langs->trans("Search"), 'search'); + $out.= img_picto($langs->trans("Search"), 'search'); } } else diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b799e0e2359..452ff89d914 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -54,9 +54,10 @@ class FormActions * @param string $htmlname Name of html prefix for html fields (selectX and valX) * @param integer $showempty Show an empty line if select is used * @param integer $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) + * @param string $morecss More css on select field * @return void */ - function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete',$showempty=0,$onlyselect=0) + function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') { global $langs,$conf; @@ -120,7 +121,7 @@ class FormActions { //var_dump($selected); if ($selected == 'done') $selected='100'; - print ''; if ($showempty) print ''; foreach($listofstatus as $key => $val) { diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ab58854f2c4..1d5e8714aad 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -327,7 +327,7 @@ class FormMail extends Form { $out.= '
'."\n"; $out.= $langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1); - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); $out.= '   '; $out.= ''; $out.= '   '; @@ -341,7 +341,7 @@ class FormMail extends Form { $out.= '
'."\n"; $out.= $langs->trans('SelectMailModel').': '; // Do not put disabled on option, it is already on select and it makes chrome crazy. - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1); $out.= '   '; $out.= ''; $out.= '   '; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 30cedf57d51..0f2e6a837ef 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -170,6 +170,7 @@ class Translate * @param int $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK + * @see loadLangs */ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfileonly=0) { diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 4e3cf7a0928..3a35bfb2cc2 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -94,7 +94,7 @@ class Utils $filelog=''; if (! empty($conf->syslog->enabled)) { - $filelog=SYSLOG_FILE; + $filelog=$conf->global->SYSLOG_FILE; $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); } diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index b7ceaa0982e..c8863ce8f61 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -180,7 +180,7 @@ function length_accounta($accounta) if ($accounta < 0 || empty($accounta)) return ''; - if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; + if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta; $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; if (! empty($a)) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 2a734b5f161..2016807efe9 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -624,6 +624,11 @@ function defaultvalues_prepare_head() $head[$h][2] = 'sortorder'; $h++; + $head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=focus"; + $head[$h][1] = $langs->trans("DefaultFocus"); + $head[$h][2] = 'focus'; + $h++; + /*$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey"; $head[$h][1] = $langs->trans("TranslationKeySearch"); $head[$h][2] = 'searchkey'; @@ -807,7 +812,7 @@ function activateModule($value,$withdeps=1) return $ret; } - $result=$objMod->init(); + $result=$objMod->init(); // Enable module if ($result <= 0) { $ret['errors'][]=$objMod->error; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 1f83690b096..4e9b458c3d0 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -76,7 +76,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 49218ddf141..9ba57abf302 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -181,10 +181,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt }); } console.log("ajax_autocompleter new value selected, we trigger change on original component so field #search_'.$htmlname.'"); + $("#search_'.$htmlname.'").trigger("change"); // We have changed value of the combo select, we must be sure to trigger all js hook binded on this event. This is required to trigger other javascript change method binded on original field by other code. } ,delay: 500 }).data("ui-autocomplete")._renderItem = function( ul, item ) { + return $("
  • ") .data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0 .append( \'\' + item.label + "" ) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index cbf4af402ae..3d33fcb71f2 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1628,8 +1628,26 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu // Wrapping pour les apercu intervention elseif (($modulepart == 'apercufichinter' || $modulepart == 'apercuficheinter') && !empty($conf->ficheinter->dir_output)) { - if ($fuser->rights->ficheinter->lire) $accessallowed=1; - $original_file=$conf->ficheinter->dir_output.'/'.$original_file; + if ($fuser->rights->ficheinter->lire) $accessallowed=1; + $original_file=$conf->ficheinter->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu supplier proposal + elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) + { + if ($fuser->rights->supplier_proposal->lire) $accessallowed=1; + $original_file=$conf->supplier_proposal->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu supplier order + elseif (($modulepart == 'apercusupplier_order' || $modulepart == 'apercusupplier_order') && !empty($conf->fournisseur->commande->dir_output)) + { + if ($fuser->rights->fournisseur->commande->lire) $accessallowed=1; + $original_file=$conf->fournisseur->commande->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu supplier invoice + elseif (($modulepart == 'apercusupplier_invoice' || $modulepart == 'apercusupplier_invoice') && !empty($conf->fournisseur->facture->dir_output)) + { + if ($fuser->rights->fournisseur->facture->lire) $accessallowed=1; + $original_file=$conf->fournisseur->facture->dir_output.'/'.$original_file; } // Wrapping pour les images des stats propales elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp)) @@ -2040,7 +2058,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu } // Wrapping pour les dons - else if ($modulepart == 'donation' && !empty($conf->donation->dir_output)) + else if ($modulepart == 'donation' && !empty($conf->don->dir_output)) { if ($fuser->rights->don->lire || preg_match('/^specimen/i',$original_file)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b6cf92aa81d..e3c6cb7d5cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -248,70 +248,74 @@ function dol_shutdown() */ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) { - if (empty($method)) - { - $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); - - // Management of default values - if (! isset($_GET['sortfield'])) // If we did a click on a field to sort, we do no apply default values - { - if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) - { - $relativepathstring = $_SERVER["PHP_SELF"]; - if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); - $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); - $relativepathstring = preg_replace('/^\//', '', $relativepathstring); - global $user; - if (! empty($user->default_values)) // $user->default_values defined from menu default values, and values loaded not at first - { - //var_dump($user->default_values[$relativepathstring]['createform']); - if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname]; - } - } - // Management of default search_filters and sort order - elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) - { - $relativepathstring = $_SERVER["PHP_SELF"]; - if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); - $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); - $relativepathstring = preg_replace('/^\//', '', $relativepathstring); - global $user; - if (! empty($user->default_values)) // $user->default_values defined from menu default values, and values loaded not at first - { - //var_dump($user->default_values[$relativepathstring]); - if ($paramname == 'sortfield') - { - if (isset($user->default_values[$relativepathstring]['sortorder'])) - { - foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) - { - if ($out) $out.=', '; - $out.=$key; - } - } - } - elseif ($paramname == 'sortorder') - { - if (isset($user->default_values[$relativepathstring]['sortorder'])) - { - foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) - { - if ($out) $out.=', '; - $out.=$val; - } - } - } - elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname])) $out = $user->default_values[$relativepathstring]['filters'][$paramname]; - } - } - } - } + if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:''; elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:''); elseif ($method==4) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:(isset($_COOKIE[$paramname])?$_COOKIE[$paramname]:'')); else return 'BadThirdParameterForGETPOST'; - + + if (empty($method) || $method == 3 || $method == 4) + { + global $conf; + + // Management of default values + if (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_DISABLE_DEFAULT_VALUES is on + { + if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + { + $relativepathstring = $_SERVER["PHP_SELF"]; + if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); + $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); + $relativepathstring = preg_replace('/^\//', '', $relativepathstring); + global $user; + if (! empty($user->default_values)) // $user->default_values defined from menu default values, and values loaded not at first + { + //var_dump($user->default_values[$relativepathstring]['createform']); + if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname]; + } + } + // Management of default search_filters and sort order + //elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + elseif (! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) + { + $relativepathstring = $_SERVER["PHP_SELF"]; + if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring); + $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); + $relativepathstring = preg_replace('/^\//', '', $relativepathstring); + global $user; + if (! empty($user->default_values)) // $user->default_values defined from menu default values + { + //var_dump($user->default_values[$relativepathstring]); + if ($paramname == 'sortfield') + { + if (isset($user->default_values[$relativepathstring]['sortorder'])) + { + foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) + { + if ($out) $out.=', '; + $out.=dol_string_nospecial($key, ''); + } + } + } + elseif ($paramname == 'sortorder') + { + if (isset($user->default_values[$relativepathstring]['sortorder'])) + { + foreach($user->default_values[$relativepathstring]['sortorder'] as $key => $val) + { + if ($out) $out.=', '; + $out.=dol_string_nospecial($val, ''); + } + } + } + elseif (isset($user->default_values[$relativepathstring]['filters'][$paramname])) + $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$paramname], ''); + } + } + } + } + if (! empty($check)) { // Replace vars like __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__ @@ -1065,11 +1069,12 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; $modulepart='unknown'; - if ($object->element == 'societe') $modulepart='societe'; - if ($object->element == 'contact') $modulepart='contact'; - if ($object->element == 'member') $modulepart='memberphoto'; - if ($object->element == 'user') $modulepart='userphoto'; - if ($object->element == 'product') $modulepart='product'; + if ($object->element == 'societe') $modulepart='societe'; + if ($object->element == 'contact') $modulepart='contact'; + if ($object->element == 'member') $modulepart='memberphoto'; + if ($object->element == 'user') $modulepart='userphoto'; + if ($object->element == 'product') $modulepart='product'; + if (class_exists("Imagick")) { if ($object->element == 'propal') $modulepart='propal'; @@ -1077,6 +1082,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->element == 'facture') $modulepart='facture'; if ($object->element == 'fichinter') $modulepart='ficheinter'; if ($object->element == 'contrat') $modulepart='contract'; + if ($object->element == 'supplier_proposal') $modulepart='supplier_proposal'; + if ($object->element == 'order_supplier') $modulepart='supplier_order'; + if ($object->element == 'invoice_supplier') $modulepart='supplier_invoice'; } if ($object->element == 'product') @@ -1102,19 +1110,26 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { if ($showimage) { - if ($modulepart != 'unknown') + if ($modulepart != 'unknown') { $phototoshow=''; - // Check if a preview file is available - if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract')) && class_exists("Imagick")) + if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract', 'supplier_order', 'supplier_proposal', 'supplier_invoice')) && class_exists("Imagick")) { $objectref = dol_sanitizeFileName($object->ref); $dir_output = $conf->$modulepart->dir_output . "/"; - $filepath = $dir_output . $objectref . "/"; + if (in_array($modulepart, array('invoice_supplier', 'supplier_invoice'))) + { + $subdir = get_exdir($object->id, 2, 0, 0, $object, $modulepart).$objectref; + } + else + { + $subdir = get_exdir($object->id, 0, 0, 0, $object, $modulepart).$objectref; + } + $filepath = $dir_output . $subdir . "/"; $file = $filepath . $objectref . ".pdf"; - $relativepath = $objectref.'/'.$objectref.'.pdf'; - + $relativepath = $subdir.'/'.$objectref.'.pdf'; + // Define path to preview pdf file (preview precompiled "file.ext" are "file.ext_preview.png") $fileimage = $file.'_preview.png'; // If PDF has 1 page $fileimagebis = $file.'_preview-0.png'; // If PDF has more than one page @@ -1137,7 +1152,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (file_exists($fileimage)) { $phototoshow = '
    '; - $phototoshow.= ''; + $phototoshow.= ''; $phototoshow.= '
    '; } // Si fichier png PDF de plus d'1 page trouve @@ -1145,7 +1160,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { $preview = preg_replace('/\.png/','',$relativepathimage) . "-0.png"; $phototoshow = '
    '; - $phototoshow.= '

    '; + $phototoshow.= '

    '; $phototoshow.= '

    '; } } @@ -1171,7 +1186,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $width=80; $cssclass='photorefcenter'; $nophoto=img_picto('', 'title_agenda', '', false, 1); - $morehtmlleft.='
    No photo
    '; } else { @@ -1179,8 +1193,8 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $picto = $object->picto; if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub $nophoto=img_picto('', 'object_'.$picto, '', false, 1); - $morehtmlleft.='
    No photo
    '; } + $morehtmlleft.='
    No photo
    '; $morehtmlleft.=''; } } @@ -4466,7 +4480,8 @@ function yn($yesno, $case=1, $color=0) /** * Return a path to have a directory according to object. - * New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') + * New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') + * or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') if multidir_output not defined. * Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/" * * @param string $num Id of object (deprecated, $object will be used in future) @@ -4487,7 +4502,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart) if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product'; if (! empty($level) && in_array($modulepart, $arrayforoldpath)) { - // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided + // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided. if (empty($alpha)) $num = preg_replace('/([^0-9])/i','',$num); else $num = preg_replace('/^.*\-/i','',$num); $num = substr("000".$num, -$level); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 66d66ec7c8f..b36da631635 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1161,7 +1161,7 @@ function check_value($mask,$value) // If an offset is asked if (! empty($reg[2]) && preg_match('/^\+/',$reg[2])) $maskoffset=preg_replace('/^\+/','',$reg[2]); - if (! empty($reg[3]) && preg_match('^\+',$reg[3])) $maskoffset=preg_replace('/^\+/','',$reg[3]); + if (! empty($reg[3]) && preg_match('/^\+/',$reg[3])) $maskoffset=preg_replace('/^\+/','',$reg[3]); // Define $sqlwhere diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 2fc447daffd..e83faee6c8d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -599,7 +599,14 @@ function pdf_getSubstitutionArray($outputlangs) $substitutionarray=array( '__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_EMAIL__' => $mysoc->email, - '__USER_ID__' => $user->id, + '__MYCOMPANY_PROFID1__' => $mysoc->idprof1, + '__MYCOMPANY_PROFID2__' => $mysoc->idprof2, + '__MYCOMPANY_PROFID3__' => $mysoc->idprof3, + '__MYCOMPANY_PROFID4__' => $mysoc->idprof4, + '__MYCOMPANY_PROFID5__' => $mysoc->idprof5, + '__MYCOMPANY_PROFID6__' => $mysoc->idprof6, + '__MYCOMPANY_CAPITAL__' => $mysoc->capital, + '__USER_ID__' => $user->id, '__USER_LOGIN__' => $user->login, '__USER_LASTNAME__' => $user->lastname, '__USER_FIRSTNAME__' => $user->firstname, diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 5139128a5d8..a14645a3152 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -197,12 +197,6 @@ function dol_loginfunction($langs,$conf,$mysoc) if (! GETPOST("username")) $focus_element='username'; else $focus_element='password'; - $login_background=DOL_URL_ROOT.'/theme/login_background.png'; - if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png')) - { - $login_background=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'; - } - $demologin=''; $demopassword=''; if (! empty($dolibarr_main_demo)) diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 4350edc3797..3b3cde1d66a 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -59,6 +59,11 @@ function user_prepare_head($object) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; + $head[$h][1] = $langs->trans("UserGUISetup"); + $head[$h][2] = 'guisetup'; + $h++; + if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; @@ -67,15 +72,27 @@ function user_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserGUISetup"); - $head[$h][2] = 'guisetup'; - $h++; - if (! empty($conf->agenda->enabled)) { + if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; + $MAXAGENDA=$conf->global->AGENDA_EXT_NB; + + $i=1; + $nbagenda = 0; + while ($i <= $MAXAGENDA) + { + $key=$i; + $name='AGENDA_EXT_NAME_'.$object->id.'_'.$key; + $src='AGENDA_EXT_SRC_'.$object->id.'_'.$key; + $offsettz='AGENDA_EXT_OFFSETTZ_'.$object->id.'_'.$key; + $color='AGENDA_EXT_COLOR_'.$object->id.'_'.$key; + $i++; + + if (! empty($object->conf->$name)) $nbagenda++; + } + $head[$h][0] = DOL_URL_ROOT.'/user/agenda_extsites.php?id='.$object->id; - $head[$h][1] = $langs->trans("ExtSites"); + $head[$h][1] = $langs->trans("ExtSites").($nbagenda ? ' '.$nbagenda.'' : ''); $head[$h][2] = 'extsites'; $h++; } @@ -426,7 +443,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; - // BackgroundColor + // Background color THEME_ELDY_BACKBODY if ($foruserprofile) { /* @@ -609,7 +626,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default")); } - print '   ('.$langs->trans("Default").': 3c3c14) '; + print '   ('.$langs->trans("Default").': 3c3c14) '; print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; @@ -654,9 +671,14 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''); if ($color) print ''; - else print $langs->trans("Default"); + else + { + //print ''; + //print ''.$langs->trans("Default").''; + print $langs->trans("Default"); + } } - print '   ('.$langs->trans("Default").': 000078) '; + print '   ('.$langs->trans("Default").': 000078) '; print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 54cddfcaa96..9106c345fda 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -211,14 +211,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accounting', 6__+MAX_llx_menu__, '/accountancy/index.php?leftmenu=accountancy', 'MenuAccountancy', 0, 'accountancy', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Setup insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 22, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); - insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 80, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 90, __ENTITY__); -- Binding insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index e95359e5683..d2d8e36b8ca 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -269,7 +269,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM print ''; print ''; print ''; print ''; print ''."\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3ce2a872658..b7a372e50bd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -165,7 +165,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->loan->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), 'module'=>'comptabilite|accounting|facture|supplier_invoice|don|tax|salaries|loan'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -478,7 +478,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print ''; print ''; print ''; print ''; print ''."\n"; @@ -947,26 +947,27 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $langs->load("accountancy"); - $permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); + $permtoshowmenu=(! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); $newmenu->add("/accountancy/index.php?leftmenu=accountancy",$langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Chart of account if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/index.php?leftmenu=accountancy_admin", $langs->trans("Setup"),1,$user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin', 1); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 10); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 20); - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 22); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingJournals"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_journal', 10); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chartmodel', 20); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 30); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_chart', 31); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 40); if (! empty($conf->facture->enabled) || ! empty($conf->fournisseur->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); } if (! empty($conf->tax->enabled)) { - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=7&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuTaxAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); } if (! empty($conf->expensereport->enabled)) { - if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 30); + if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"),2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_default', 50); } /* not required yet, already supported by default account if (! empty($conf->loan->enabled)) @@ -977,7 +978,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { if (preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/don/admin/donation.php?from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDonationAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_donation', 47); }*/ - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 50); + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_admin/',$leftmenu)) $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 2, $user->rights->accounting->chartofaccount, '', $mainmenu, 'accountancy_admin_product', 60); // Binding if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy",$langs->trans("CustomersVentilation"),1,$user->rights->accounting->bind->write, '', $mainmenu, 'dispatch_customer'); @@ -1006,8 +1007,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Multi journal $sql = "SELECT rowid, code, label, nature"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; - // $sql.= " WHERE entity = ".$conf->entity; - $sql.= " ORDER BY code"; + $sql.= " WHERE entity = ".$conf->entity; + $sql.= " ORDER BY nature"; $resql = $db->query($sql); if ($resql) @@ -1020,14 +1021,25 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu while ($i < $numr) { $objp = $db->fetch_object($resql); - - if ($objp->nature == 1) $nature="sells"; - if ($objp->nature == 2) $nature="purchases"; - if ($objp->nature == 3) $nature="bank"; - if ($objp->nature == 4) $nature="various"; + + $nature=''; + // Must match array $sourceList defined into journals_list.php + if ($objp->nature == 2) $nature="sells"; + if ($objp->nature == 3) $nature="purchases"; + if ($objp->nature == 4) $nature="bank"; + if ($objp->nature == 1) $nature="various"; if ($objp->nature == 9) $nature="hasnew"; - - if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&code_journal='.$objp->code,dol_trunc($objp->label,25),2,$user->rights->accounting->comptarapport->lire); + + // To enable when page exists + if (empty($conf->global->MAIN_FEATURES_LEVEL)) + { + if ($nature == 'various' || $nature == 'hasnew') $nature=''; + } + + if ($nature) + { + if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy/',$leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&code_journal='.$objp->code,dol_trunc($objp->label,25),2,$user->rights->accounting->comptarapport->lire); + } $i++; } } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 48ce35f1532..d0559268c52 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -795,6 +795,37 @@ class DolibarrModules // Can not be abstract, because we need to insta } + /** + * Gives the last author of activation + * + * @return array Array array('authorid'=>Id of last activation user, 'lastactivationdate'=>Date of last activation) + */ + function getLastActivationInfo() + { + global $conf; + + $sql = "SELECT tms, note FROM ".MAIN_DB_PREFIX."const"; + $sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->const_name."'"; + $sql.= " AND entity IN (0, ".$conf->entity.")"; + + dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) $err++; + else + { + $obj=$this->db->fetch_object($resql); + $tmp=array(); + if ($obj->note) + { + $tmp=json_decode($obj->note, true); + } + if ($obj) return array('authorid'=>$tmp['authorid'], 'ip'=>$tmp['ip'], 'lastactivationdate'=>$this->db->jdate($obj->tms)); + } + + return array(); + } + + /** * Insert constants for module activation * @@ -802,7 +833,7 @@ class DolibarrModules // Can not be abstract, because we need to insta */ function _active() { - global $conf; + global $conf, $user; $err = 0; @@ -817,10 +848,13 @@ class DolibarrModules // Can not be abstract, because we need to insta $resql=$this->db->query($sql); if (! $resql) $err++; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible,entity) VALUES"; + $note=json_encode(array('authorid'=>$user->id, 'ip'=>$_SERVER['REMOTE_ADDR'])); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name, value, visible, entity, note) VALUES"; $sql.= " (".$this->db->encrypt($this->const_name,1); - $sql.= ",".$this->db->encrypt('1',1); - $sql.= ",0,".$entity.")"; + $sql.= ", ".$this->db->encrypt('1',1); + $sql.= ", 0, ".$entity; + $sql.= ", '".$this->db->escape($note)."')"; dol_syslog(get_class($this)."::_active", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d1697b767bd..3f7a73a650c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -49,7 +49,7 @@ class pdf_rouget extends ModelePdfExpedition $this->db = $db; $this->name = "rouget"; - $this->description = $langs->trans("DocumentModelSimple"); + $this->description = $langs->trans("DocumentModelStandardPDF"); $this->type = 'pdf'; $formatarray=pdf_getFormat(); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 83306b95adb..4d889f84902 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -65,7 +65,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->db = $db; $this->name = 'soleil'; - $this->description = $langs->trans("DocumentModelStandard"); + $this->description = $langs->trans("DocumentModelStandardPDF"); // Dimension page pour format A4 $this->type = 'pdf'; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index b2349ab77a0..30e64b5de2c 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -53,7 +53,7 @@ class modProduct extends DolibarrModules $this->module_position = 20; // 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 = "Gestion des produits"; + $this->description = "Product management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; @@ -83,7 +83,14 @@ class modProduct extends DolibarrModules $this->const[$r][3] = 'Module to control product codes'; $this->const[$r][4] = 0; $r++; - + + /*$this->const[$r][0] = "PRODUCT_ADDON_PDF"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "standard"; + $this->const[$r][3] = 'Default module for document generation'; + $this->const[$r][4] = 0; + $r++;*/ + // Boxes $this->boxes = array( 0=>array('file'=>'box_produits.php','enabledbydefaulton'=>'Home'), diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 7a5db7fcffd..c385ece4b26 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -51,7 +51,7 @@ class modService extends DolibarrModules $this->module_position = 30; // 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 = "Gestion des services"; + $this->description = "Service management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index e80966afb81..be6817062b6 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -117,32 +117,37 @@ class modStock extends DolibarrModules $this->rights[4][4] = 'mouvement'; $this->rights[4][5] = 'creer'; - if ($conf->global->MAIN_LEVEL_FEATURES >= 2) { + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $this->rights[5][0] = 1006; + $this->rights[5][0] = 1011; $this->rights[5][1] = 'inventoryReadPermission'; // Permission label $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[6][0] = 1007; + $this->rights[6][0] = 1012; $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'create'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][5] = 'create'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[7][0] = 1008; + $this->rights[7][0] = 1013; $this->rights[7][1] = 'inventoryWritePermission'; // Permission label $this->rights[7][3] = 0; // Permission by default for new user (0/1) - $this->rights[7][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[7][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[7][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[7][0] = 1009; - $this->rights[7][1] = 'inventoryValidatePermission'; // Permission label - $this->rights[7][3] = 0; // Permission by default for new user (0/1) - $this->rights[7][4] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[8][0] = 1014; + $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label + $this->rights[8][3] = 0; // Permission by default for new user (0/1) + $this->rights[8][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[8][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[7][0] = 1010; - $this->rights[7][1] = 'inventoryChangePMPPermission'; // Permission label - $this->rights[7][3] = 0; // Permission by default for new user (0/1) - $this->rights[7][4] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[9][0] = 1015; + $this->rights[9][1] = 'inventoryChangePMPPermission'; // Permission label + $this->rights[9][3] = 0; // Permission by default for new user (0/1) + $this->rights[9][4] = 'advance_inventory'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) } diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 5dca2b8378e..29df1127242 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -92,8 +92,8 @@ class pdf_standard extends ModelePDFProduct $langs->load("companies"); $this->db = $db; - $this->name = "PDF template"; - $this->description = $langs->trans("DocumentModelPdf"); + $this->name = "standard"; + $this->description = $langs->trans("DocumentModelStandardPDF"); // Dimension page pour format A4 $this->type = 'pdf'; @@ -107,15 +107,9 @@ class pdf_standard extends ModelePDFProduct $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PRODUCT_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement $this->option_codeproduitservice = 0; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte - $this->option_credit_note = 0; // Support credit notes - $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->option_freetext = 0; // Support add of a personalised text // Recupere emetteur $this->emetteur=$mysoc; @@ -262,7 +256,7 @@ class pdf_standard extends ModelePDFProduct } if ($object->weight) { - $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").': '.$object->length.'x'.$object->width.'x'.$object->height, 0, 1); + $pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, $langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").': '.($object->length != ''?$object->length:'?').' x '.($object->width != ''?$object->width:'?').' x '.($object->height != ''?$object->height:'?'), 0, 1); $nexY = $pdf->GetY(); } if ($object->surface) diff --git a/htdocs/core/modules/supplier_payment/pdf/index.html b/htdocs/core/modules/supplier_payment/doc/index.html similarity index 100% rename from htdocs/core/modules/supplier_payment/pdf/index.html rename to htdocs/core/modules/supplier_payment/doc/index.html diff --git a/htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php similarity index 98% rename from htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php rename to htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index edb37ddcdde..2b645e4a263 100644 --- a/htdocs/core/modules/supplier_payment/pdf/pdf_cow.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; /** * Class to generate the supplier invoices with the canelle model */ -class pdf_cow extends ModelePDFSuppliersPayments +class pdf_standard extends ModelePDFSuppliersPayments { var $db; var $name; @@ -70,8 +70,8 @@ class pdf_cow extends ModelePDFSuppliersPayments $langs->load("bills"); $this->db = $db; - $this->name = "cow"; - $this->description = $langs->trans('SuppliersPaymentModel'); + $this->name = "standard"; + $this->description = $langs->trans('DocumentModelStandardPDF'); // Dimension page pour format A4 $this->type = 'pdf'; @@ -85,10 +85,6 @@ class pdf_cow extends ModelePDFSuppliersPayments $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_multilang = 1; // Dispo en plusieurs langues $this->franchise=!$mysoc->tva_assuj; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3b2812c7b90..6efe3ead81c 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -635,16 +635,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('','', $default_font_size - 1); - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); - - $posy=$pdf->GetY()+4; - } - $posxval=52; // Show shipping date @@ -723,7 +713,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy=$pdf->GetY()+3; } - if (empty($conf->global->SUPPLIER_PROPOSAL_PDF_HIDE_PAYMENTTERMCOND)) + if (! empty($conf->global->SUPPLIER_PROPOSAL_PDF_SHOW_PAYMENTTERMCOND)) { // Show payment mode if ($object->mode_reglement_code @@ -1037,7 +1027,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $resteapayer = $object->total_ttc - $deja_regle; if (! empty($object->paye)) $resteapayer=0; */ - + if ($deja_regle > 0) { $index++; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 1245041d98a..81e3936d300 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -258,7 +258,7 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) { -
  • "; + print '' . "\n"; + print ''; $linktoprod = '' . img_object($langs->trans("ShowProduct"), 'product') . ' ' . $objp->ref . ''; $linktoprod .= ' - ' . $objp->label . "\n"; @@ -500,7 +498,7 @@ if ($id > 0 || ! empty($ref)) { print ""; } - $var = ! $var; + // Define unit price for PMP calculation $up_ht_disc = $objp->subprice; if (! empty($objp->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) $up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU'); @@ -517,11 +515,21 @@ if ($id > 0 || ! empty($ref)) { print ''; // Warehouse column print ''; - print ''; + print ''; print ''; // Dispatch column print ''; print ''; - print ''; + + print ''; print '
    '.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
    '.$langs->trans("CompanyName").''; @@ -799,7 +794,6 @@ else print ''; print ''; print ''; - $var=true; // Managing Director(s) @@ -965,7 +959,6 @@ else print ''; print ''; print "\n"; - $var=true; print ''; print ''; print "\n"; - $var=true; - print ""; + print ""; print ''; } else { - print ''; + print ''; print '\n"; $i=1; - $var=false; - while ($objp = $db->fetch_object($resql)) - { - $account_id = $objp->bid; - if (! isset($accounts[$objp->bid])) - $accounts[$objp->bid]=0; - $accounts[$objp->bid] += 1; - print ''; - print ''; - print ''; // Date operation - print ''; - print ''; - print ''; - print ''; - // Link to payment - print ''; - // Link to bank transaction - print ''; - // Action button - print ''; - print ''; - - $i++; - } + if ($num > 0) + { + while ($objp = $db->fetch_object($resql)) + { + $account_id = $objp->bid; + if (! isset($accounts[$objp->bid])) + $accounts[$objp->bid]=0; + $accounts[$objp->bid] += 1; + + print ''; + print ''; + print ''; // Date operation + print ''; + print ''; + print ''; + print ''; + // Link to payment + print ''; + // Link to bank transaction + print ''; + // Action button + print ''; + print ''; + + $i++; + } + } + else + { + print ''; + } + print "
    '.$langs->trans("CompanyIds").''.$langs->trans("Value").'
    '.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
    '.$langs->trans("FiscalMonthStart").''; @@ -983,10 +976,9 @@ else print ''.$langs->trans("VATManagement").''.$langs->trans("Description").' 
    global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."
    global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."'; print ""; print ""; @@ -995,7 +987,7 @@ else print "\n"; - print ""; + print ""; print '\n"; + print "\n"; print "\n"; print "\t\t\n"; print "\t\n"; } @@ -162,7 +162,7 @@ foreach($fulltree as $key => $val) 'rowid'=>$val['rowid'], 'fk_menu'=>$val['fk_parent'], 'entry'=>'
    global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."
    global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."'; print ""; print ""; @@ -1018,10 +1010,9 @@ else print ''; print ''; print "\n"; - $var=true; - print ""; + print ""; print ''; // Products - print ''; + print ''; print ''; // Services - print ''; + print ''; print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 170c37a79bf..e913d59a4a7 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2006-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -38,7 +38,7 @@ $choice=GETPOST('choice'); $filelog=''; if (! empty($conf->syslog->enabled)) { - $filelog=SYSLOG_FILE; + $filelog=$conf->global->SYSLOG_FILE; $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); } diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 42feea8f8ec..0c7574b7ec4 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -167,7 +167,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup'); $head=user_admin_prepare_head(); -dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), 0, 'user'); +dol_fiche_head($head,'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); print '
    ".$langs->trans("VATIsNotUsedDesc")."
    '.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").' 
    global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."
    global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; print ""; @@ -1049,7 +1040,7 @@ else print "\n"; - print ""; + print ""; print ''; print ''; print ''; print "\n"; -$var=true; foreach ($syslogModules as $moduleName) { @@ -210,7 +209,7 @@ foreach ($syslogModules as $moduleName) print ''; print ''; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 788d8604584..dbdce59c3c5 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -136,10 +136,10 @@ else print ''; print ''; print "\n"; - print ''; + print ''; print '\n"; - print ''; + print ''; print '\n"; print "
    ".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
    global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."
    global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; print ""; @@ -1069,10 +1060,9 @@ else print ''; print ''; print "\n"; - $var=true; - print ""; + print ""; print '
    '.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").' 
    global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."
    global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; print ""; @@ -1101,7 +1091,7 @@ else print "\n"; - print ""; + print ""; print '\n"; foreach ($list as $key) { - - print ''; + print ''; // Param $libelle = $langs->trans($key); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 8a9bd4f209b..dd37e4987e5 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -37,7 +37,7 @@ if (!$user->admin) accessforbidden(); $id=GETPOST('rowid','int'); $action=GETPOST('action','alpha'); -$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder' +$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); @@ -84,6 +84,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_array_options=array(); } +if ($action == 'setMAIN_ENABLE_DEFAULT_VALUES') +{ + if (GETPOST('value')) dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 1, 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 0, 'chaine', 0, '', $conf->entity); +} if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('actionmodify')) { @@ -185,6 +190,23 @@ print load_fiche_titre($langs->trans("DefaultValues"),'','title_setup'); print $langs->trans("DefaultValuesDesc")."
    \n"; print "
    \n"; +print $langs->trans("EnableDefaultValues").' '; +if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) +{ + // Button off, click to enable + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; +} +else +{ + // Button on, click to disable + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; +} +print "

    \n"; + $param='&mode='.$mode; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -210,6 +232,10 @@ if ($mode == 'sortorder') { print info_admin($langs->trans("WarningSettingSortOrder")).'
    '; } +if ($mode == 'focus') +{ + print info_admin($langs->trans("FeatureNotYetAvailable")).'
    '; +} print ''; print ''; @@ -217,11 +243,13 @@ print ''; print ''; +// Page $texthelp=$langs->trans("PageUrlForDefaultValues"); if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php'); else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php'); $texturl=$form->textwithpicto($langs->trans("Url"), $texthelp); print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'page,param','',$param,'',$sortfield,$sortorder); +// Field $texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); if ($mode != 'sortorder') { @@ -233,26 +261,32 @@ else $textkey=$form->textwithpicto($langs->trans("Field"), $texthelp); } print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'param','',$param,'',$sortfield,$sortorder); -if ($mode != 'sortorder') +// Value +if ($mode != 'focus') { - $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
    '; - // See list into GETPOST - $texthelp.='__USERID__
    '; - $texthelp.='__SUPERVISORID__
    '; - $texthelp.='__MYCOUNTRYID__
    '; - $texthelp.='__DAY__
    '; - $texthelp.='__MONTH__
    '; - $texthelp.='__YEAR__
    '; - if (! empty($conf->multicompany->enabled)) $texthelp.='__ENTITYID__
    '; - $textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, ''); + if ($mode != 'sortorder') + { + $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
    '; + // See list into GETPOST + $texthelp.='__USERID__
    '; + $texthelp.='__SUPERVISORID__
    '; + $texthelp.='__MYCOUNTRYID__
    '; + $texthelp.='__DAY__
    '; + $texthelp.='__MONTH__
    '; + $texthelp.='__YEAR__
    '; + if (! empty($conf->multicompany->enabled)) $texthelp.='__ENTITYID__
    '; + $textvalue=$form->textwithpicto($langs->trans("Value"), $texthelp, 1, 'help', '', 0, 2, ''); + } + else + { + $texthelp='ASC or DESC'; + $textvalue=$form->textwithpicto($langs->trans("SortOrder"), $texthelp); + } + print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder); } -else -{ - $texthelp='ASC or DESC'; - $textvalue=$form->textwithpicto($langs->trans("SortOrder"), $texthelp); -} -print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder); +// Entity if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder); +// Actions print ''; print "\n"; @@ -261,15 +295,21 @@ print "\n"; print "\n"; print ''; +// Page print ''."\n"; +// Field print ''; -print ''; +// Value +if ($mode != 'focus') +{ + print ''; +} // Limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) { @@ -311,28 +351,33 @@ if ($result) print ''; + // Page print ''."\n"; - // Key + // Field print ''."\n"; // Value - print ''; - + if ($mode != 'focus') + { + print ''; + } + + // Actions print ''; - + print "\n"; print "\n"; $i++; diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 161b1aac45d..74525a6855b 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -105,7 +105,7 @@ foreach ($eventstolog as $key => $arr) print ''."\n"; } } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index dad17585e2e..b8626827595 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -230,7 +230,7 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_set $head=expensereport_admin_prepare_head(); -dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), 0, 'trip'); +dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip'); // Interventions numbering model /* diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 65e1592eff8..d1d3aacc9cc 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -74,7 +74,7 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_set $head = expensereport_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), 0, 'trip'); +dol_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), -1, 'trip'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 0b01f56857e..d99fd9456d9 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 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 @@ -265,7 +265,7 @@ print load_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'title_setu $head=fichinter_admin_prepare_head(); -dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), 0, 'intervention'); +dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention'); // Interventions numbering model @@ -291,7 +291,6 @@ foreach ($dirmodels as $reldir) $handle = opendir($dir); if (is_resource($handle)) { - $var=true; while (($file = readdir($handle))!==false) { @@ -410,7 +409,6 @@ print "\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/fichinter/doc/"); @@ -532,7 +530,6 @@ print ''; print ''; print "\n"; print "\n"; -$var=true; $substitutionarray=pdf_getSubstitutionArray($langs); $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); @@ -540,7 +537,6 @@ $htmltext = ''.$langs->trans("AvailableVariables").':
    '; foreach($substitutionarray as $key => $val) $htmltext.=$key.'
    '; $htmltext.='
    '; -$var=! $var; print ''; print ''; print ''; @@ -590,11 +586,10 @@ print '\n"; // Use services duration -$var = !$var; print ''; print ''; print ''; -print ''; +print ''; print ''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 193ee35a80f..739a6fa4c88 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -50,18 +50,6 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); -// List of supported permanent search area -$searchform=array(); -/* deprecated -if (empty($conf->use_javascript_ajax)) -{ - $searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE"); - $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE); - $searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users")); - $searchformmodule=array('Module1Name','Module1Name','Module50Name','Module310Name','Module400Name'); -} -*/ - /* * Action @@ -275,21 +263,6 @@ if ($action == 'edit') // Edit show_theme(null,1); print '
    '; - // List of permanent supported search box - if (! empty($searchform)) - { - print '
    global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
    global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; print ""; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index c097b9f39b1..0c42659357a 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2013-2016 Philippe Grand + * Copyright (C) 2013-2017 Philippe Grand * Copyright (C) 2014 Marcos GarcĂ­a * * This program is free software; you can redistribute it and/or modify @@ -119,7 +119,7 @@ print '
    '; print ''; print ''; print "\n"; -print ''; +print ''; print '\n"; -print ''; +print ''; print '\n"; print "
    '.$langs->trans('OptionMode').''.$langs->trans('Description').'
    '.$langs->trans('OptionModeTrue').'
    '.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) @@ -133,7 +133,7 @@ print ''.nl2br($langs->trans('OptionModeTrueDesc')); // // print nl2br($langs->trans('OptionModeTrueInfoExpert')); //} print "
    '.$langs->trans('OptionModeVirtual').'
    '.$langs->trans('OptionModeVirtual').''.nl2br($langs->trans('OptionModeVirtualDesc'))."
    \n"; @@ -149,8 +149,7 @@ print "
    '; print ''; print ''; print ''; print ''; -print ''; -print ''; + print ''; + print '
    '; if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->page; else print ''; print ''; if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->param; else print ''; print ''; - /*print ''; - print ''; - print ''; - print ''; - */ - if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->value; - else print ''; - print ''; + /*print ''; + print ''; + print ''; + print ''; + */ + if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) print $obj->value; + else print ''; + print ''; if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) { @@ -349,7 +394,7 @@ if ($result) print ''; } print '
    '; $key='MAIN_LOGEVENTS_'.$arr['id']; $value=$conf->global->$key; - print ''; + print ''; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").' 
    '; print ''; print "
    '; print $langs->trans("UseServicesDurationOnFichinter"); print '
    '; - print ''; - foreach ($searchform as $key => $value) - { - print ''; - } - print '
    '.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
    '.$searchformtitle[$key].''; - print $form->selectyesno($searchform[$key],$searchformconst[$key],1); - print '
    '; - print '
    '; - } - // Other print ''; print ''; @@ -476,23 +449,6 @@ else // Show print '
    '; - // List of search forms to show - if (! empty($searchform)) - { - print '
    '.$langs->trans("Parameters").''.$langs->trans("Value").'
    '; - print ''; - foreach ($searchform as $key => $value) - { - - print ''; - print ''; - } - print '
    '.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
    '.$searchformtitle[$key].''.yn($searchformconst[$key]).''; - if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); - print '
    '; - print '
    '; - } - // Other print ''; print ''; diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index ee6b9ef74ee..86d963ed54f 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -96,9 +96,7 @@ print "\n"; foreach ($list as $key) { - - - print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 08ba76dca99..a403cf1f493 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos GarcĂ­a * Copyright (C) 2012 Christophe Battarel @@ -659,11 +659,10 @@ if ($resql) // Lines with values while ($i < $num) { - $var = ! $var; $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code))) { $tmpaction='edit'; @@ -697,7 +696,7 @@ if ($resql) // Show value for field if ($showfield) { - print ''."\n"; - // Config link + // Link config if (! empty($objMod->config_page_url) && !$disableSetup) { if (is_array($objMod->config_page_url)) { - print ''; + print ''; } else { - print ''; + print ''; } } else { - print ''; + print ''; } } else // Module not yet activated { - print '\n"; - print ''; + + // Link config + print ''; } print "\n"; @@ -782,7 +784,7 @@ if ($mode == 'marketplace') print ''; - print "\n"; + print "\n"; $url='https://www.dolistore.com'; print ''; print ''; @@ -790,7 +792,7 @@ if ($mode == 'marketplace') print ''; - print "\n"; + print "\n"; $url='https://partners.dolibarr.org'; print ''; print ''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 34aa49ea237..c1bb5909e15 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -93,7 +93,6 @@ print $langs->trans("ListOfSupportedOauthProviders").'

    '; print '
    '.$langs->trans("Parameters").''.$langs->trans("Value").'
    '; // To create an artificial CR for the current tr we are on + print '
    '; // To create an artificial CR for the current tr we are on $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; @@ -789,7 +788,7 @@ if ($resql) // Show value for field if ($showfield) { - print '
    '; // To create an artificial CR for the current tr we are on + print '
    '; // To create an artificial CR for the current tr we are on $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 94bfa8e05bb..d318566ff61 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -330,6 +330,24 @@ if ($mode == 'desc') else $text.=$langs->trans("Disabled"); $text.='
    '; + $tmp = $objMod->getLastActivationInfo(); + $authorid = $tmp['authorid']; + if ($authorid > 0) + { + $tmpuser = new User($db); + $tmpuser->fetch($authorid); + $text.=''.$langs->trans("LastActivationAuthor").': '; + $text.= $tmpuser->getNomUrl(1); + $text.='
    '; + } + $ip = $tmp['ip']; + if ($ip) + { + $text.=''.$langs->trans("LastActivationIP").': '; + $text.= $ip; + $text.='
    '; + } + $moduledesclong=$objMod->getDescLong(); if ($moduledesclong) $text.='

    '.$moduledesclong.'
    '; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 4eb82e6183c..433508be908 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -402,9 +402,9 @@ if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouM print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'title_setup'); // Start to show page -if ($mode=='common') print $langs->trans("ModulesDesc")."
    \n"; -if ($mode=='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
    \n"; -if ($mode=='deploy') print $langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
    \n"; +if ($mode=='common') print ''.$langs->trans("ModulesDesc")."
    \n"; +if ($mode=='marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
    \n"; +if ($mode=='deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
    \n"; $h = 0; @@ -428,8 +428,6 @@ $h++; print "
    \n"; -$var=true; - if ($mode == 'common') { @@ -642,7 +640,8 @@ if ($mode == 'common') { $disableSetup = 0; - print '
    '; + // Link enable/disabme + print ''; if (! empty($arrayofwarnings[$modName])) { print ''."\n"; @@ -664,12 +663,12 @@ if ($mode == 'common') } print ''; + print ''; $i=0; foreach ($objMod->config_page_url as $page) { @@ -695,22 +694,23 @@ if ($mode == 'common') } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; + // Link enable/disable + print ''; if (! empty($objMod->always_enabled)) { // Should never happened @@ -756,7 +756,9 @@ if ($mode == 'common') print "\n"; } print "'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'
    '.$langs->trans("DoliStoreDesc").'
    '.$langs->trans("DoliPartnersDesc").'
    '; -$var = true; $i=0; foreach ($list as $key) @@ -116,31 +115,27 @@ foreach ($list as $key) if ($supported) { $redirect_uri=$urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$key[0]].'_oauthcallback.php'; - $var = !$var; - print ''; + print ''; print ''; print ''; } else { - $var = !$var; - print ''; + print ''; print ''; print ''; print ''; } // Api Id - $var = !$var; - print ''; + print ''; print ''; print ''; // Api Secret - $var = !$var; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 2e650c75696..6698be8b01f 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -306,8 +306,9 @@ else // Show $var=true; // Misc options - print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'
    '; - $var=true; + print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'',''); + + print '
    '.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print '
    '.$langs->trans("UseTheFollowingUrlAsRedirectURI").''.$langs->trans("FeatureNotYetSupported").'
    '; print '
    '; print '
    '; print ''; @@ -357,7 +358,7 @@ else // Show print '
    '; - print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'
    '; + print load_fiche_titre($langs->trans("PDFAddressForging"),'',''); print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; print ''; @@ -444,7 +445,7 @@ else // Show print '
    '; // Other - print load_fiche_titre($langs->trans("Other"),'','').'
    '; + print load_fiche_titre($langs->trans("Other"),'',''); $var=true; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '; print ''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index daafab71053..5acbeb2e627 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -140,7 +140,6 @@ if ($result) { $num = $db->num_rows($result); $i = 0; - $var = True; $oldmod = ""; while ($i < $num) @@ -187,8 +186,7 @@ if ($result) } - print ''; - + print ''; print ''; + print ''; // Param $label = $langs->trans($key); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c8204f213c2..050e00e6278 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -149,6 +149,7 @@ if (! empty($conf->productbatch->enabled)) //if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //{ print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); +print '
    '; //} // Title rule for stock decrease @@ -433,7 +434,7 @@ if ($virtualdiffersfromphysical) print '
    '; -if ($conf->global->MAIN_LEVEL_FEATURES >= 2) +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { $var=false; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.img_object('',$picto).' '.$objMod->getName(); print ' '; diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index a04b23ce4fe..52470be4106 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -99,7 +99,7 @@ foreach ($list as $key) { - print '
    '; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 19f0e6fc8e2..de128184d18 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 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 @@ -205,7 +205,7 @@ print "
    "; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company'); // Supplier invoice numbering module @@ -361,7 +361,6 @@ foreach ($dirmodels as $reldir) if (is_dir($dir)) { - $var=true; $handle=opendir($dir); @@ -379,7 +378,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new FactureFournisseur($db)); - print "
    \n"; + print "\n"; print "\n"; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index a30e7de2654..030a507ce20 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2011-2017 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 @@ -234,7 +234,7 @@ print "
    "; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company'); // Supplier order numbering module @@ -382,7 +382,6 @@ print '
    '."\n"; clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/"); @@ -403,7 +402,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new CommandeFournisseur($db)); - print "\n"; + print "\n"; print "\n"; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 40caa94c8a8..adaa114b1ca 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -65,7 +65,7 @@ if ($action == 'updateMask') } }else if ($action == 'setmod') { - dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity); } // define constants for models generator that need parameters @@ -138,7 +138,7 @@ else if ($action == 'specimen') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/supplier_payment/pdf/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/supplier_payment/doc/pdf_".$modele.".modules.php",0); if (file_exists($file)) { $filefound=1; @@ -188,7 +188,7 @@ print load_fiche_titre($langs->trans("SupplierPaymentSetup"),$linkback,'title_se print "
    "; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), -1, 'company'); /* * Numbering module @@ -198,12 +198,6 @@ if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMEN print load_fiche_titre($langs->trans("PaymentsNumberingModule"), '', ''); -/* - * Document templates generators - */ -print '
    '; -print load_fiche_titre($langs->trans("BillsPDFModules"),'',''); - // Load array def with activated templates $def = array(); $sql = "SELECT nom"; @@ -349,6 +343,12 @@ foreach ($dirmodels as $reldir) print '
    "; print (empty($module->name)?$name:$module->name); print "
    "; print (empty($module->name)?$name:$module->name); print "
    '; +/* + * Document templates generators + */ +print '
    '; +print load_fiche_titre($langs->trans("PaymentsPDFModules"),'',''); + print ''."\n"; print ''."\n"; print ''."\n"; @@ -363,11 +363,10 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/supplier_payment/pdf/"); + $dir = dol_buildpath($reldir."core/modules/supplier_payment/doc/"); if (is_dir($dir)) { - $var=true; $handle=opendir($dir); @@ -385,7 +384,7 @@ foreach ($dirmodels as $reldir) $module = new $classname($db, new PaiementFourn($db)); - print "\n"; + print "\n"; print "\n"; @@ -441,8 +440,6 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

    '.$langs->trans("FeaturesSupported").':'; $htmltooltip.='
    '.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
    '.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); print ''; @@ -459,7 +456,7 @@ foreach ($dirmodels as $reldir) } } -print '
    '.$langs->trans("Name").'
    "; print (empty($module->name)?$name:$module->name); print "'; print $form->textwithpicto('',$htmltooltip,1,0); print '

    '; +print '
    '; dol_fiche_end(); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 701362e38f4..4e0bd1d0dd2 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -79,7 +79,7 @@ print "
    \n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index e741eb6cd75..26b3b42e970 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -79,7 +79,7 @@ print "
    \n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 00550995d19..bcad8121afc 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -75,7 +75,7 @@ print "
    \n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index f83ad1348fc..97d505144bb 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -76,7 +76,7 @@ print "
    \n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), 0, 'company'); +dol_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index e3ad8a3616c..03a1872c90c 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -197,7 +197,6 @@ print '
    '.$langs->trans("Type").''.$langs->trans("Value").'
    '; - print ' '; + print ' '; print $module->getName(); print '
    '.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
    '.$langs->trans('OptionVATDefault').'
    '.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); print "
    '.$langs->trans('OptionVATDebitOption').'
    '.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
    \n"; @@ -152,7 +152,7 @@ else print '
     '.$langs->trans("Buy").''.$langs->trans("Sell").'
    '.$langs->trans("Product").'
    '.$langs->trans("Product").''; print $langs->trans("OnDelivery"); print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; @@ -163,7 +163,7 @@ else print '
    '.$langs->trans("Services").'
    '.$langs->trans("Services").''; if ($tax_mode == 0) { @@ -206,7 +206,7 @@ foreach ($list as $key) { - print '
    '; print ''; @@ -205,7 +205,7 @@ print ''; print '
    '; - +print '
    '; $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index db5ef3cbf59..4642e6d3183 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -151,7 +151,7 @@ print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup'); $head=user_admin_prepare_head(); -dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), 0, 'user'); +dol_fiche_head($head,'usergroupcard', $langs->trans("MenuUsersAndGroups"), -1, 'user'); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php index 06e9a7b93a4..9aecc4dfb0a 100644 --- a/htdocs/admin/websites.php +++ b/htdocs/admin/websites.php @@ -441,7 +441,6 @@ if ($id) { $num = $db->num_rows($resql); $i = 0; - $var=true; if ($num) { print '
    '; @@ -499,7 +498,6 @@ if ($id) // Lines with values while ($i < $num) { - $var = ! $var; $obj = $db->fetch_object($resql); //print_r($obj); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index d9595cd7fb0..af104fd4bfe 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -120,8 +120,7 @@ foreach($workflowcodes as $key => $params) $oldfamily = $family; } - $var = !$var; - print "
    ".img_object('', $picto).$langs->trans('desc'.$key); if (! empty($params['warning'])) { diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index d84713d1e62..c1882ce4bf9 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -62,14 +62,15 @@ function printBookmarksList($aDb, $aLangs) */ $ret.= ''."\n"; - $ret.= ''; + $ret.= ''; $ret.= '"; - print $cat->description; + print dolGetFirstLineOfText($cat->description); print "
    '. - ''. + //''. ''. '
    color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.''.dolGetFirstLineOfText($desc).''.dolGetFirstLineOfText($desc).''.img_view().'
    ' ); @@ -181,13 +181,13 @@ $nbofentries=(count($data) - 1); if ($nbofentries > 0) { - print '
    '; + print '
    '; tree_recur($data,$data[0],0); print '
    '; print ''; // Location @@ -1428,7 +1428,7 @@ if ($id > 0) } else { $value = $object->array_options["options_" . $key]; } - print '\n"; } @@ -1491,7 +1491,7 @@ if ($id > 0) { if (empty($conf->global->AGENDA_DISABLE_BUILDDOC)) { - print '
     

    '; + print '
    '; print ''; // ancre /* @@ -1512,8 +1512,6 @@ if ($id > 0) print '
    '; - - print '
     
    '; } } } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d365acef38b..47ef8093c1a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -43,8 +43,8 @@ if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MA if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=$conf->global->AGENDA_EXT_NB; -$filter=GETPOST("filter",'',3); -$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); +$filter = GETPOST("filter",'',3); +$filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -1155,21 +1155,6 @@ else // View by day echo '
    '.img_picto_common('','treemenu/branchbottom.gif').''; print $langs->trans("NoCategoryYet"); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index fc4fc218971..30b13bc3007 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -337,7 +337,7 @@ if ($action == 'add') unset($_SESSION['assignedtouser']); $moreparam=''; - if ($user->id != $object->userownerid) $moreparam="usertodo=-1"; // We force to remove filter so created record is visible when going back to per user view. + if ($user->id != $object->userownerid) $moreparam="filtert=-1"; // We force to remove filter so created record is visible when going back to per user view. $db->commit(); if (! empty($backtopage)) @@ -706,7 +706,7 @@ if ($action == 'create') if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent='0'; else if (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100; } - $formactions->form_select_status_action('formaction',$percent,1,'complete'); + $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print '
    '.$label.''; + print '
    '.$label.''; print $extrafields->showOutputField($key,$value); print "
    '; } - -/* TODO Export - print ' - - - - - -'; -*/ - llxFooter(); $db->close(); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 8b1dc424239..3e6224e0c41 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -64,8 +64,8 @@ $dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GET if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); -$filter=GETPOST("filter",'',3); -$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); +$filter = GETPOST("filter",'',3); +$filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 4f4ef6a580c..544da904cdc 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -38,8 +38,8 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; -$filter=GETPOST("filter",'',3); -$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); +$filter = GETPOST("filter",'',3); +$filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; //$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -250,7 +250,7 @@ $picto='calendarweek'; $nav.='   '; $nav.=''; $nav.=''; -$nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; @@ -714,7 +714,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; + url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 61bf98634c4..2a707cd2d8f 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -38,8 +38,8 @@ if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; -$filter=GETPOST("filter",'',3); -$filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); +$filter = GETPOST("filter",'',3); +$filtert = GETPOST("filtert","int",3); $usergroup = GETPOST("usergroup","int",3); //if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id; //$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -252,7 +252,7 @@ $picto='calendarweek'; $nav.='   '; $nav.=''; $nav.=''; -$nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; @@ -663,7 +663,6 @@ else if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user"; $sql.= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user',1).")"; if ($usergroup > 0) $sql.= " AND ug.fk_usergroup = ".$usergroup; - //if (GETPOST("usertodo","int",3) > 0) $sql.=" AND u.rowid = ".GETPOST("usertodo","int",3); //print $sql; $resql=$db->query($sql); if ($resql) @@ -816,7 +815,7 @@ jQuery(document).ready(function() { else if (ids.indexOf(",") > -1) /* There is several events */ { /* alert(\'several events\'); */ - url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; + url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day; window.location.href = url; } else /* One event */ diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index fe582d56656..0b4c3c239f9 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1057,7 +1057,7 @@ else // Print mail content print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'title_generic'); - dol_fiche_head(''); + dol_fiche_head('', '', '', -1); print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 444669a6f49..00fa9df2b91 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -497,7 +497,10 @@ if (empty($reshook)) $array_options = $lines[$i]->array_options; } - $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit); + $tva_tx = $lines[$i]->tva_tx; + if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit); if ($result > 0) { $lineid = $result; diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index ec7ca53357a..fd508b03256 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -16,9 +16,10 @@ * along with this program. If not, see . */ - use Luracast\Restler\RestException; +use Luracast\Restler\RestException; + +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; /** * API class for orders @@ -275,9 +276,9 @@ class Proposals extends DolibarrApi $request_data->array_options, $request_data->fk_unit, $this->element, - $request_data->id - // not used anymore ? - // $request_data->fk_remise_except + $request_data->id, + $request_data->pu_ht_devise, + $request_data->fk_remise_except ); if ($updateRes > 0) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 46c6a55cf2f..7c60e3290f3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -187,7 +187,7 @@ class Propal extends CommonObject /** * Billed or processed quote */ - const STATUS_BILLED = 4; + const STATUS_BILLED = 4; // Todo rename into STATUS_CLOSE ? /** * Constructor @@ -253,6 +253,8 @@ class Propal extends CommonObject $tva_tx = get_default_tva($mysoc,$this->thirdparty,$prod->id); $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; + $vat_src_code = ''; // May be defined into tva_tx + $localtax1_tx = get_localtax($tva_tx,1,$mysoc,$this->thirdparty,$tva_npr); $localtax2_tx = get_localtax($tva_tx,2,$mysoc,$this->thirdparty,$tva_npr); @@ -273,6 +275,7 @@ class Propal extends CommonObject $line->qty=$qty; $line->subprice=$price; $line->remise_percent=$remise_percent; + $line->vat_src_code=$vat_src_code; $line->tva_tx=$tva_tx; $line->fk_unit=$prod->fk_unit; if ($tva_npr) $line->info_bits = 1; @@ -315,6 +318,7 @@ class Propal extends CommonObject $line->fk_propal=$this->id; $line->fk_remise_except=$remise->id; $line->desc=$remise->description; // Description ligne + $line->vat_src_code=$remise->vat_src_code; $line->tva_tx=$remise->tva_tx; $line->subprice=-$remise->amount_ht; $line->fk_product=0; // Id produit predefined @@ -391,15 +395,16 @@ class Propal extends CommonObject * @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $origin 'order', ... * @param int $origin_id Id of origin object - * @return int >0 if OK, <0 if KO * @param double $pu_ht_devise Unit price in currency + * @param int $fk_remise_except Id discount if line is from a discount + * @return int >0 if OK, <0 if KO * @see add_product */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise=0, $fk_remise_except=0) { global $mysoc, $conf, $langs; - dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type"); + dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; // Clean parameters @@ -515,6 +520,8 @@ class Propal extends CommonObject $this->line->localtax1_type = $localtaxes_type[0]; $this->line->localtax2_type = $localtaxes_type[2]; $this->line->fk_product=$fk_product; + $this->line->product_type=$type; + $this->line->fk_remise_except=$fk_remise_except; $this->line->remise_percent=$remise_percent; $this->line->subprice=$pu_ht; $this->line->rang=$rangtouse; @@ -524,7 +531,6 @@ class Propal extends CommonObject $this->line->total_localtax1=$total_localtax1; $this->line->total_localtax2=$total_localtax2; $this->line->total_ttc=$total_ttc; - $this->line->product_type=$type; $this->line->special_code=$special_code; $this->line->fk_parent_line=$fk_parent_line; $this->line->fk_unit=$fk_unit; @@ -698,7 +704,8 @@ class Propal extends CommonObject $this->line->label = $label; $this->line->desc = $desc; $this->line->qty = $qty; - $this->line->product_type = $type; + $this->line->product_type = $type; + $this->line->vat_src_code = $vat_src_code; $this->line->tva_tx = $txtva; $this->line->localtax1_tx = $txlocaltax1; $this->line->localtax2_tx = $txlocaltax2; @@ -708,7 +715,6 @@ class Propal extends CommonObject $this->line->subprice = $pu_ht; $this->line->info_bits = $info_bits; - $this->line->vat_src_code = $vat_src_code; $this->line->total_ht = $total_ht; $this->line->total_tva = $total_tva; $this->line->total_localtax1 = $total_localtax1; @@ -1301,7 +1307,7 @@ class Propal extends CommonObject $this->note = $obj->note_private; // TODO deprecated $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->statut = $obj->fk_statut; + $this->statut = (int) $obj->fk_statut; $this->statut_libelle = $obj->statut_label; $this->datec = $this->db->jdate($obj->datec); // TODO deprecated @@ -1366,102 +1372,13 @@ class Propal extends CommonObject $this->lines = array(); /* - * Lignes propales liees a un produit ou non + * Lines */ - $sql = "SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,"; - $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,"; - $sql.= " d.fk_unit,"; - $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,'; - $sql.= ' d.date_start, d.date_end'; - $sql.= ' ,d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; - $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; - $sql.= " WHERE d.fk_propal = ".$this->id; - $sql.= " ORDER by d.rang"; - - $result = $this->db->query($sql); - if ($result) + $result=$this->fetch_lines(); + if ($result < 0) { - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafieldsline=new ExtraFields($this->db); - $line = new PropaleLigne($this->db); - $extralabelsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); - - $num = $this->db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $objp = $this->db->fetch_object($result); - - $line = new PropaleLigne($this->db); - - $line->rowid = $objp->rowid; //Deprecated - $line->id = $objp->rowid; - $line->fk_propal = $objp->fk_propal; - $line->fk_parent_line = $objp->fk_parent_line; - $line->product_type = $objp->product_type; - $line->label = $objp->custom_label; - $line->desc = $objp->description; // Description ligne - $line->qty = $objp->qty; - $line->tva_tx = $objp->tva_tx; - $line->localtax1_tx = $objp->localtax1_tx; - $line->localtax2_tx = $objp->localtax2_tx; - $line->subprice = $objp->subprice; - $line->fk_remise_except = $objp->fk_remise_except; - $line->remise_percent = $objp->remise_percent; - $line->price = $objp->price; // TODO deprecated - - $line->info_bits = $objp->info_bits; - $line->total_ht = $objp->total_ht; - $line->total_tva = $objp->total_tva; - $line->total_localtax1 = $objp->total_localtax1; - $line->total_localtax2 = $objp->total_localtax2; - $line->total_ttc = $objp->total_ttc; - $line->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); - $line->pa_ht = $marginInfos[0]; - $line->marge_tx = $marginInfos[1]; - $line->marque_tx = $marginInfos[2]; - $line->special_code = $objp->special_code; - $line->rang = $objp->rang; - - $line->fk_product = $objp->fk_product; - - $line->ref = $objp->product_ref; // TODO deprecated - $line->product_ref = $objp->product_ref; - $line->libelle = $objp->product_label; // TODO deprecated - $line->product_label = $objp->product_label; - $line->product_desc = $objp->product_desc; // Description produit - $line->fk_product_type = $objp->fk_product_type; - $line->fk_unit = $objp->fk_unit; - - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - - // Multicurrency - $line->fk_multicurrency = $objp->fk_multicurrency; - $line->multicurrency_code = $objp->multicurrency_code; - $line->multicurrency_subprice = $objp->multicurrency_subprice; - $line->multicurrency_total_ht = $objp->multicurrency_total_ht; - $line->multicurrency_total_tva = $objp->multicurrency_total_tva; - $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - - $line->fetch_optionals($line->id,$extralabelsline); - - $this->lines[$i] = $line; - //dol_syslog("1 ".$line->fk_product); - //print "xx $i ".$this->lines[$i]->fk_product; - $i++; - } - $this->db->free($result); + return -3; } - else - { - $this->error=$this->db->lasterror(); - return -1; - } - return 1; } @@ -1475,6 +1392,114 @@ class Propal extends CommonObject return -1; } } + + /** + * Load array lines + * + * @param int $only_product Return only physical products + * @return int <0 if KO, >0 if OK + */ + function fetch_lines($only_product=0) + { + $this->lines=array(); + + $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; + $sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,'; + $sql.= ' d.fk_unit,'; + $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,'; + $sql.= ' d.date_start, d.date_end'; + $sql.= ' ,d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as d'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (d.fk_product = p.rowid)'; + $sql.= ' WHERE d.fk_propal = '.$this->id; + if ($only_product) $sql .= ' AND p.fk_product_type = 0'; + $sql.= ' ORDER by d.rang'; + + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + + $num = $this->db->num_rows($result); + + $i = 0; + while ($i < $num) + { + $objp = $this->db->fetch_object($result); + + $line = new PropaleLigne($this->db); + + $line->rowid = $objp->rowid; //Deprecated + $line->id = $objp->rowid; + $line->fk_propal = $objp->fk_propal; + $line->fk_parent_line = $objp->fk_parent_line; + $line->product_type = $objp->product_type; + $line->label = $objp->custom_label; + $line->desc = $objp->description; // Description ligne + $line->qty = $objp->qty; + $line->vat_src_code = $objp->vat_src_code; + $line->tva_tx = $objp->tva_tx; + $line->localtax1_tx = $objp->localtax1_tx; + $line->localtax2_tx = $objp->localtax2_tx; + $line->subprice = $objp->subprice; + $line->fk_remise_except = $objp->fk_remise_except; + $line->remise_percent = $objp->remise_percent; + $line->price = $objp->price; // TODO deprecated + + $line->info_bits = $objp->info_bits; + $line->total_ht = $objp->total_ht; + $line->total_tva = $objp->total_tva; + $line->total_localtax1 = $objp->total_localtax1; + $line->total_localtax2 = $objp->total_localtax2; + $line->total_ttc = $objp->total_ttc; + $line->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; + $line->special_code = $objp->special_code; + $line->rang = $objp->rang; + + $line->fk_product = $objp->fk_product; + + $line->ref = $objp->product_ref; // TODO deprecated + $line->product_ref = $objp->product_ref; + $line->libelle = $objp->product_label; // TODO deprecated + $line->product_label = $objp->product_label; + $line->product_desc = $objp->product_desc; // Description produit + $line->fk_product_type = $objp->fk_product_type; + $line->fk_unit = $objp->fk_unit; + + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + + // Multicurrency + $line->fk_multicurrency = $objp->fk_multicurrency; + $line->multicurrency_code = $objp->multicurrency_code; + $line->multicurrency_subprice = $objp->multicurrency_subprice; + $line->multicurrency_total_ht = $objp->multicurrency_total_ht; + $line->multicurrency_total_tva = $objp->multicurrency_total_tva; + $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + + $line->fetch_optionals(); + + $this->lines[$i] = $line; + //dol_syslog("1 ".$line->fk_product); + //print "xx $i ".$this->lines[$i]->fk_product; + $i++; + } + + $this->db->free($result); + + return 1; + } + else + { + $this->error=$this->db->lasterror(); + return -3; + } + } /** * Update value of extrafields on the proposal @@ -3326,8 +3351,10 @@ class Propal extends CommonObject */ function getLinesArray() { - // For other object, here we call fetch_lines. But fetch_lines does not exists on proposal - + // TODO Duplicate with fetch_lines ? Wich one to keep ? + + $this->lines = array(); + $sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,'; $sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,'; @@ -3591,7 +3618,7 @@ class PropaleLigne extends CommonObjectLine */ function fetch($rowid) { - $sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.tva_tx,'; + $sql = 'SELECT pd.rowid, pd.fk_propal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.vat_src_code, pd.tva_tx,'; $sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,'; $sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.fk_product_fournisseur_price as fk_fournprice, pd.buy_price_ht as pa_ht, pd.special_code, pd.rang,'; $sql.= ' pd.fk_unit,'; @@ -3617,6 +3644,7 @@ class PropaleLigne extends CommonObjectLine $this->qty = $objp->qty; $this->price = $objp->price; // deprecated $this->subprice = $objp->subprice; + $this->vat_src_code = $objp->vat_src_code; $this->tva_tx = $objp->tva_tx; $this->remise = $objp->remise; // deprecated $this->remise_percent = $objp->remise_percent; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index e369a1a7217..8459a4a5e9e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -377,7 +377,10 @@ if (empty($reshook)) $array_options = $lines[$i]->array_options; } - $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->fk_unit, $object->origin, $lines[$i]->rowid); + $tva_tx = $lines[$i]->tva_tx; + if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->fk_unit, $object->origin, $lines[$i]->rowid); if ($result < 0) { $error++; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 82050b7b586..70168b5e1a9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1103,6 +1103,7 @@ class Commande extends CommonOrder $line->desc = $object->lines[$i]->desc; $line->price = $object->lines[$i]->price; $line->subprice = $object->lines[$i]->subprice; + $line->vat_src_code = $object->lines[$i]->vat_src_code; $line->tva_tx = $object->lines[$i]->tva_tx; $line->localtax1_tx = $object->lines[$i]->localtax1_tx; $line->localtax2_tx = $object->lines[$i]->localtax2_tx; @@ -1466,7 +1467,8 @@ class Commande extends CommonOrder $tva_tx = get_default_tva($mysoc,$this->thirdparty,$prod->id); $tva_npr = get_default_npr($mysoc,$this->thirdparty,$prod->id); if (empty($tva_tx)) $tva_npr=0; - + $vat_src_code = ''; // May be defined into tva_tx + $localtax1_tx=get_localtax($tva_tx,1,$this->thirdparty,$mysoc,$tva_npr); $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); @@ -1485,6 +1487,7 @@ class Commande extends CommonOrder $line->qty=$qty; $line->subprice=$price; $line->remise_percent=$remise_percent; + $line->vat_src_code=$vat_src_code; $line->tva_tx=$tva_tx; $line->localtax1_tx=$localtax1_tx; $line->localtax2_tx=$localtax2_tx; @@ -1703,6 +1706,7 @@ class Commande extends CommonOrder $line->fk_commande=$this->id; $line->fk_remise_except=$remise->id; $line->desc=$remise->description; // Description ligne + $line->vat_src_code=$remise->vat_src_code; $line->tva_tx=$remise->tva_tx; $line->subprice=-$remise->amount_ht; $line->price=-$remise->amount_ht; @@ -1758,7 +1762,7 @@ class Commande extends CommonOrder $this->lines=array(); $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx,'; - $sql.= ' l.localtax1_tx, l.localtax2_tx, l.fk_remise_except, l.remise_percent, l.subprice, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht, l.rang, l.info_bits, l.special_code,'; + $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.fk_remise_except, l.remise_percent, l.subprice, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht, l.rang, l.info_bits, l.special_code,'; $sql.= ' l.total_ht, l.total_ttc, l.total_tva, l.total_localtax1, l.total_localtax2, l.date_start, l.date_end,'; $sql.= ' l.fk_unit,'; $sql.= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,'; @@ -1795,9 +1799,11 @@ class Commande extends CommonOrder $line->vat_src_code = $objp->vat_src_code; $line->tva_tx = $objp->tva_tx; - $line->localtax1_tx = $objp->localtax1_tx; + $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; - $line->total_ht = $objp->total_ht; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; + $line->total_ht = $objp->total_ht; $line->total_ttc = $objp->total_ttc; $line->total_tva = $objp->total_tva; $line->total_localtax1 = $objp->total_localtax1; @@ -3806,6 +3812,7 @@ class OrderLine extends CommonOrderLine $this->qty = $objp->qty; $this->price = $objp->price; $this->subprice = $objp->subprice; + $this->vat_src_code = $objp->vat_src_code; $this->tva_tx = $objp->tva_tx; $this->localtax1_tx = $objp->localtax1_tx; $this->localtax2_tx = $objp->localtax2_tx; @@ -4117,6 +4124,7 @@ class OrderLine extends CommonOrderLine $sql = "UPDATE ".MAIN_DB_PREFIX."commandedet SET"; $sql.= " description='".$this->db->escape($this->desc)."'"; $sql.= " , label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); + $sql.= " , vat_src_code=".(! empty($this->vat_src_code)?"'".$this->db->escape($this->vat_src_code)."'":"''"); $sql.= " , tva_tx=".price2num($this->tva_tx); $sql.= " , localtax1_tx=".price2num($this->localtax1_tx); $sql.= " , localtax2_tx=".price2num($this->localtax2_tx); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index df6e6b1c8c8..5b3bb3a58fe 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -1,11 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2014-2016 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016 Marcos GarcĂ­a + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2014-2017 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Marcos GarcĂ­a * * 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 @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formbank.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; $langs->load("banks"); $langs->load("bills"); @@ -664,7 +664,10 @@ else print ''; print ''; + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch('',$object->account_number); + + print $accountingaccount->getNomUrl(0,1,1,'',1); } else { print $object->account_number; } @@ -683,13 +686,11 @@ else print '
    '.$langs->trans("AccountancyCode").''; if (! empty($conf->accounting->enabled)) { - print length_accountg($object->account_number).'
    '; - print ''; print '
    '; print '
    '; print '
    '; - print ''; // Categories @@ -703,8 +704,7 @@ else print ''; print '
    '.dol_htmlentitiesbr($object->comment).'
    '; - - + if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT) { print '
    '; diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index a92b23fc617..b808fa8f596 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("accountancy"); +$langs->load("compta"); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); @@ -87,6 +88,7 @@ $arrayfields=array( 'b.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'b.number'=>array('label'=>$langs->trans("AccountIdShort"), 'checked'=>1), 'b.account_number'=>array('label'=>$langs->trans("AccountAccounting"), 'checked'=>$conf->accountancy->enabled), + 'b.accountancy_journal'=>array('label'=>$langs->trans("AccountancyJournal"), 'checked'=>$conf->accountancy->enabled), 'toreconcile'=>array('label'=>$langs->trans("TransactionsToConciliate"), 'checked'=>1), 'b.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'b.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -139,7 +141,7 @@ $title=$langs->trans('BankAccounts'); // Load array of financial accounts (opened by default) $accounts = array(); -$sql = "SELECT rowid, label, courant, rappro, account_number, datec as date_creation, tms as date_update"; +$sql = "SELECT rowid, label, courant, rappro, account_number, accountancy_journal, datec as date_creation, tms as date_update"; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); // Add fields from hooks @@ -286,6 +288,7 @@ print '
    '; print ''."\n"; print ''; + // Ref if (! empty($arrayfields['b.ref']['checked'])) { @@ -306,19 +309,25 @@ if (! empty($arrayfields['accountype']['checked'])) print ''; } -// Number +// Bank number if (! empty($arrayfields['b.number']['checked'])) { print ''; } -// Number +// Account number if (! empty($arrayfields['b.account_number']['checked'])) { print ''; } +// Accountancy journal +if (! empty($arrayfields['b.accountancy_journal']['checked'])) +{ + print ''; +} // Transactions to reconcile if (! empty($arrayfields['toreconcile']['checked'])) { @@ -394,6 +403,7 @@ if (! empty($arrayfields['b.label']['checked'])) print_liste_field_titr if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titre($arrayfields['accountype']['label'],$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'],$_SERVER["PHP_SELF"],'b.number','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['b.account_number']['checked'])) print_liste_field_titre($arrayfields['b.account_number']['label'],$_SERVER["PHP_SELF"],'b.account_number','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['b.accountancy_journal']['checked'])) print_liste_field_titre($arrayfields['b.accountancy_journal']['label'],$_SERVER["PHP_SELF"],'b.accountancy_journal','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'],$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -482,6 +492,14 @@ foreach ($accounts as $key=>$type) if (! $i) $totalarray['nbfield']++; } + // Accountancy journal + if (! empty($arrayfields['b.accountancy_journal']['checked'])) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Transactions to reconcile if (! empty($arrayfields['toreconcile']['checked'])) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7e08bdc7fae..5d2ba74c48a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1066,7 +1066,7 @@ if (empty($reshook)) { if ($typeamount == 'amount') { - $amountdeposit[] = $valuedeposit; + $amountdeposit[0] = $valuedeposit; } else { @@ -1084,9 +1084,11 @@ if (empty($reshook)) } if ($totalamount != 0) { - $amountdeposit[$lines[$i]->tva] = ($totalamount * $valuedeposit) / 100; + $tva_tx = $lines[$i]->tva_tx; + if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + $amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100; } else { - $amountdeposit[] = 0; + $amountdeposit[0] = 0; } } else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); @@ -1211,11 +1213,15 @@ if (empty($reshook)) $array_options = $lines[$i]->array_options; } - // View third's localtaxes for now - $localtax1_tx = get_localtax($lines[$i]->tva_tx, 1, $object->thirdparty); - $localtax2_tx = get_localtax($lines[$i]->tva_tx, 2, $object->thirdparty); + $tva_tx = $lines[$i]->tva_tx; + if (! empty($lines[$i]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + + // View third's localtaxes for NOW and do not use value from origin. + // TODO Is this really what we want ? Yes if source if template invoice but what if proposal or order ? + $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty); - $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $localtax1_tx, $localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->situation_percent, $lines[$i]->fk_prev_id, $lines[$i]->fk_unit); + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $localtax1_tx, $localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->situation_percent, $lines[$i]->fk_prev_id, $lines[$i]->fk_unit); if ($result > 0) { $lineid = $result; @@ -3623,8 +3629,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - if (! empty($conf->banque->enabled)) - print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; @@ -3640,8 +3645,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - if (! empty($conf->banque->enabled)) - print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; @@ -3652,8 +3656,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; - if (! empty($conf->banque->enabled)) - print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4b9ced1c4c0..f3f0fd543fa 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -951,6 +951,7 @@ class Facture extends CommonInvoice $line->total_ht = $object->lines[$i]->total_ht; $line->total_tva = $object->lines[$i]->total_tva; $line->total_ttc = $object->lines[$i]->total_ttc; + $line->vat_src_code = $object->lines[$i]->vat_src_code; $line->tva_tx = $object->lines[$i]->tva_tx; $line->localtax1_tx = $object->lines[$i]->localtax1_tx; $line->localtax2_tx = $object->lines[$i]->localtax2_tx; @@ -1550,6 +1551,7 @@ class Facture extends CommonInvoice $facligne->fk_facture=$this->id; $facligne->fk_remise_except=$remise->id; $facligne->desc=$remise->description; // Description ligne + $facligne->vat_src_code=$remise->vat_src_code; $facligne->tva_tx=$remise->tva_tx; $facligne->subprice=-$remise->amount_ht; $facligne->fk_product=0; // Id produit predefini @@ -2398,7 +2400,7 @@ class Facture extends CommonInvoice * @param string $desc Description of line * @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $qty Quantity - * @param double $txtva Force Vat rate, -1 for auto + * @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param double $txlocaltax1 Local tax 1 rate (deprecated) * @param double $txlocaltax2 Local tax 2 rate (deprecated) * @param int $fk_product Id of predefined product/service @@ -3511,10 +3513,11 @@ class Facture extends CommonInvoice /** - * Create a withdrawal request for a standing order + * Create a withdrawal request for a standing order. + * Use the remain to pay excluding all existing open direct debit requests. * - * @param User $fuser User asking standing order - * @param float $amount Amount we request withdraw for + * @param User $fuser User asking the direct debit transfer + * @param float $amount Amount we request direct debit for * @return int <0 if KO, >0 if OK */ function demande_prelevement($fuser, $amount=0) @@ -4225,7 +4228,7 @@ class FactureLigne extends CommonInvoiceLine */ function fetch($rowid) { - $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,'; + $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.vat_src_code, fd.tva_tx,'; $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,'; $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; @@ -4253,6 +4256,7 @@ class FactureLigne extends CommonInvoiceLine $this->desc = $objp->description; $this->qty = $objp->qty; $this->subprice = $objp->subprice; + $this->vat_src_code = $objp->vat_src_code; $this->tva_tx = $objp->tva_tx; $this->localtax1_tx = $objp->localtax1_tx; $this->localtax2_tx = $objp->localtax2_tx; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 706807c8f02..cb60b8bcff5 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -35,8 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + //require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; @@ -891,7 +892,6 @@ if ($action == 'create') $object = new Facture($db); // Source invoice $product_static = new Product($db); - $formproject = new FormProjets($db); if ($object->fetch($id, $ref) > 0) { diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 625b2be518e..eed3a79335c 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -334,7 +334,7 @@ else // $head[$h][1] = $langs->trans("Info"); // $h++; - dol_fiche_head($head, $hselected, $langs->trans("Cheques"),0,'payment'); + dol_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); /* * Confirmation de la suppression du bordereau @@ -476,8 +476,7 @@ if ($action == 'new') print '
    '; print ''; print ''; print ''; print ''; + print ''.length_accountg($acc->accountancy_journal).'
    ' . $langs->trans('ListOfNextSituationInvoices') . '' . $langs->trans('AmountHT') . '' . $langs->trans('AmountTTC') . ' 
    ' . $next_invoice->getNomUrl(1) . '' . price($next_invoice->total_ht) . '' . price($next_invoice->total_ttc) . '' . $next_invoice->getLibStatut(3, $totalpaye) . '
    ' . price($total_next_ht) . '' . price($total_next_ttc) . '
    '."\n"; print ''; - print '\n"; + print ''."\n"; print '\n"; print '\n"; print '\n"; @@ -487,59 +486,57 @@ if ($action == 'new') print ''; - print "\n"; - $var=true; - - foreach ($lines[$bid] as $lid => $value) + if (count($lines[$bid])) { - + foreach ($lines[$bid] as $lid => $value) + { + $account_id = $bid; + if (! isset($accounts[$bid])) + $accounts[$bid]=0; + $accounts[$bid] += 1; - $account_id = $bid; - if (! isset($accounts[$bid])) - $accounts[$bid]=0; - $accounts[$bid] += 1; + print ''; + print ''; + print '\n"; + print '\n"; + print '\n"; + print ''; - print ''; - print ''; - print '\n"; - print '\n"; - print '\n"; - print ''; - - // Link to payment - print ''; - // Link to bank transaction - print ''; - - print '' ; - print ''; - - $i++; + // Link to payment + print ''; + // Link to bank transaction + print ''; + + print '' ; + print ''; + + $i++; + } } print "
    '.$langs->trans("DateChequeReceived").' '; - print "'.$langs->trans("DateChequeReceived").''.$langs->trans("ChequeNumber")."'.$langs->trans("CheckTransmitter")."'.$langs->trans("Bank")."'.$langs->trans("Select")."
    "; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
    '.dol_print_date($value["date"],'day').''.$value["numero"]."'.$value["emetteur"]."'.$value["banque"]."'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'
    '.dol_print_date($value["date"],'day').''.$value["numero"]."'.$value["emetteur"]."'.$value["banque"]."'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).''; - $paymentstatic->id=$value["paymentid"]; - $paymentstatic->ref=$value["paymentid"]; - if ($paymentstatic->id) - { - print $paymentstatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; - $accountlinestatic->rowid=$value["id"]; - if ($accountlinestatic->rowid) - { - print $accountlinestatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; - print ''; - print '
    '; + $paymentstatic->id=$value["paymentid"]; + $paymentstatic->ref=$value["paymentid"]; + if ($paymentstatic->id) + { + print $paymentstatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + $accountlinestatic->rowid=$value["id"]; + if ($accountlinestatic->rowid) + { + print $accountlinestatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + print ''; + print '
    "; print '
    '; @@ -686,65 +683,75 @@ else print_liste_field_titre(''); print "
    '.$i.''.dol_print_date($db->jdate($objp->date),'day').''.($objp->num_chq?$objp->num_chq:' ').''.dol_trunc($objp->emetteur,24).''.dol_trunc($objp->banque,24).''.price($objp->amount).''; - $paymentstatic->id=$objp->pid; - $paymentstatic->ref=$objp->pid; - if ($paymentstatic->id) - { - print $paymentstatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; - $accountlinestatic->rowid=$objp->rowid; - if ($accountlinestatic->rowid) - { - print $accountlinestatic->getNomUrl(1); - } - else - { - print ' '; - } - print ''; - if ($object->statut == 0) - { - print 'rowid.'">'.img_delete().''; - } - if ($object->statut == 1 && $objp->statut != 2) - { - print 'rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').''; - } - if ($objp->statut == 2) - { - print '   '.img_picto($langs->trans('CheckRejected'),'statut8').''; - } - print '
    '.$i.''.dol_print_date($db->jdate($objp->date),'day').''.($objp->num_chq?$objp->num_chq:' ').''.dol_trunc($objp->emetteur,24).''.dol_trunc($objp->banque,24).''.price($objp->amount).''; + $paymentstatic->id=$objp->pid; + $paymentstatic->ref=$objp->pid; + if ($paymentstatic->id) + { + print $paymentstatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + $accountlinestatic->rowid=$objp->rowid; + if ($accountlinestatic->rowid) + { + print $accountlinestatic->getNomUrl(1); + } + else + { + print ' '; + } + print ''; + if ($object->statut == 0) + { + print 'rowid.'">'.img_delete().''; + } + if ($object->statut == 1 && $objp->statut != 2) + { + print 'rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').''; + } + if ($objp->statut == 2) + { + print '   '.img_picto($langs->trans('CheckRejected'),'statut8').''; + } + print '
    '; + print $langs->trans("None"); + print '
    "; print ""; } diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 2d77cb71061..97dc3c1674f 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -50,8 +50,6 @@ llxHeader('',$langs->trans("ChequesArea")); print load_fiche_titre($langs->trans("ChequesArea")); -//print ''; -//print '
    '; print '
    '; $sql = "SELECT count(b.rowid)"; @@ -90,7 +88,6 @@ else } -//print '
    '; print '
    '; $max=10; @@ -98,15 +95,13 @@ $max=10; $sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref"; $sql.= ", bc.statut, bc.nbcheque"; $sql.= ", ba.label, ba.rowid as bid"; -$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc"; -$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; +$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " WHERE ba.rowid = bc.fk_bank_account"; $sql.= " AND bc.entity = ".$conf->entity; $sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC"; $sql.= $db->plimit($max); $resql = $db->query($sql); - if ($resql) { print ''; @@ -128,9 +123,8 @@ if ($resql) $accountstatic->id=$objp->bid; $accountstatic->label=$objp->label; - - print "\n"; + print ''."\n"; print ''; print ''; @@ -142,15 +136,15 @@ if ($resql) print ''; } print "
    '.$checkdepositstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->db),'day').'
    "; + $db->free($resql); } else { - dol_print_error($db); + dol_print_error($db); } -//print "
    \n"; print ''; llxFooter(); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 0e5f3fca093..e88372c4835 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -332,14 +332,20 @@ if (empty($reshook)) else { $desc = dol_htmlentitiesbr($lines[$i]->desc); } + + $txtva = $lines[$i]->vat_src_code ? $lines[$i]->tva_tx . ' (' . $lines[$i]->vat_src_code . ')' : $lines[$i]->tva_tx; + + // View third's localtaxes for now + $localtax1_tx = get_localtax($txtva, 1, $object->thirdparty); + $localtax2_tx = get_localtax($txtva, 2, $object->thirdparty); $result = $object->addline( $desc, $lines[$i]->subprice, $lines[$i]->qty, - $lines[$i]->tva_tx, - $lines[$i]->localtax1_tx, - $lines[$i]->localtax2_tx, + $txtva, + $localtax1_tx, + $localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $lines[$i]->date_start, diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f0a34e982c8..06ee9130ea9 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -616,7 +616,7 @@ class Contrat extends CommonObject // Selectionne les lignes contrats liees a un produit $sql = "SELECT p.label as product_label, p.description as product_desc, p.ref as product_ref,"; - $sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,"; + $sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,"; $sql.= " d.total_ht,"; $sql.= " d.total_tva,"; $sql.= " d.total_localtax1,"; @@ -650,9 +650,12 @@ class Contrat extends CommonObject $line->fk_contrat = $objp->fk_contrat; $line->desc = $objp->description; // Description ligne $line->qty = $objp->qty; + $line->vat_src_code = $objp->vat_src_code ; $line->tva_tx = $objp->tva_tx; $line->localtax1_tx = $objp->localtax1_tx; $line->localtax2_tx = $objp->localtax2_tx; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; $line->subprice = $objp->subprice; $line->statut = $objp->statut; $line->remise_percent = $objp->remise_percent; @@ -2722,6 +2725,7 @@ class ContratLigne extends CommonObjectLine $this->statut=(int) $this->statut; $this->label=trim($this->label); $this->description=trim($this->description); + $this->vat_src_code=trim($this->vat_src_code); $this->tva_tx=trim($this->tva_tx); $this->localtax1_tx=trim($this->localtax1_tx); $this->localtax2_tx=trim($this->localtax2_tx); @@ -2793,6 +2797,7 @@ class ContratLigne extends CommonObjectLine $sql.= " date_ouverture=".($this->date_ouverture!=''?"'".$this->db->idate($this->date_ouverture)."'":"null").","; $sql.= " date_fin_validite=".($this->date_fin_validite!=''?"'".$this->db->idate($this->date_fin_validite)."'":"null").","; $sql.= " date_cloture=".($this->date_cloture!=''?"'".$this->db->idate($this->date_cloture)."'":"null").","; + $sql.= " vat_src_code='".$this->vat_src_code."',"; $sql.= " tva_tx='".$this->tva_tx."',"; $sql.= " localtax1_tx='".$this->localtax1_tx."',"; $sql.= " localtax2_tx='".$this->localtax2_tx."',"; @@ -2921,6 +2926,7 @@ class ContratLigne extends CommonObjectLine $sql.= ") VALUES ($this->fk_contrat, '', '" . $this->db->escape($this->description) . "',"; $sql.= ($this->fk_product>0 ? $this->fk_product : "null").","; $sql.= " '".$this->qty."',"; + $sql.= " '".$this->vat_src_code."',"; $sql.= " '".$this->tva_tx."',"; $sql.= " '".$this->localtax1_tx."',"; $sql.= " '".$this->localtax2_tx."',"; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 74badc6daae..58e47a29ec8 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -406,60 +406,105 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $outputlangs->setDefaultLang($newlang); } - // Create empty PDF - $pdf=pdf_getInstance(); - if (class_exists('TCPDF')) - { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); + if(!empty($conf->global->USE_PDFTK_FOR_PDF_CONCAT)) { + // Create output dir if not exists + dol_mkdir($diroutputmassaction); + + // Defined name of merged file + $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); + $filename=preg_replace('/\s/','_',$filename); + + // Save merged file + if ($filter=='paye:0') + { + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + } + if ($year) $filename.='_'.$year; + if ($month) $filename.='_'.$month; + + if (count($files)>0) + { + + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + + $input_files = ''; + foreach($files as $f) { + $input_files.=' '.escapeshellarg($f); + } + + $cmd = 'pdftk '.$input_files.' cat output '.escapeshellarg($file); + exec($cmd); + + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); + } + } - $pdf->SetFont(pdf_getPDFFont($outputlangs)); + else { + // Create empty PDF + $pdf=pdf_getInstance(); + if (class_exists('TCPDF')) + { + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + } + $pdf->SetFont(pdf_getPDFFont($outputlangs)); - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); - // Add all others - foreach($files as $file) - { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } - } + // Add all others + foreach($files as $file) + { + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } + } - // Create output dir if not exists - dol_mkdir($diroutputmassaction); + // Create output dir if not exists + dol_mkdir($diroutputmassaction); - // Defined name of merged file - $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); - $filename=preg_replace('/\s/','_',$filename); - - // Save merged file - if ($filter=='paye:0') - { - if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); - else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); - } - if ($year) $filename.='_'.$year; - if ($month) $filename.='_'.$month; - if ($pagecount) - { - $now=dol_now(); - $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; - $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + // Defined name of merged file + $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel))); + $filename=preg_replace('/\s/','_',$filename); + + // Save merged file + if ($filter=='paye:0') + { + if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); + else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); + } + if ($year) $filename.='_'.$year; + if ($month) $filename.='_'.$month; + if ($pagecount) + { + $now=dol_now(); + $file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf'; + $pdf->Output($file,'F'); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); - $langs->load("exports"); - setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); + $langs->load("exports"); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans('NoPDFAvailableForDocGenAmongChecked'), null, 'errors'); + } } } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index e3a84c80a1c..00394b0e03f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -360,7 +360,7 @@ abstract class CommonDocGenerator { global $conf; - $sumpayed=''; $alreadypayed=''; + $sumpayed=$sumdeposit=$sumcreditnote=''; if ($object->element == 'facture') { $invoice_source=new Facture($this->db); @@ -369,7 +369,8 @@ abstract class CommonDocGenerator $invoice_source->fetch($object->fk_facture_source); } $sumpayed = $object->getSommePaiement(); - $alreadypayed=price($sumpayed,0,$outputlangs); + $sumdeposit = $object->getSumDepositsUsed(); + $sumcreditnote = $object->getSumCreditNotesUsed(); } $resarray=array( @@ -412,11 +413,21 @@ abstract class CommonDocGenerator $array_key.'_note_private'=>$object->note, $array_key.'_note_public'=>$object->note_public, $array_key.'_note'=>$object->note_public, // For backward compatibility + // Payments - $array_key.'_already_payed_locale'=>price($alreadypayed, 0, $outputlangs), - $array_key.'_remain_to_pay_locale'=>price($object->total_ttc - $sumpayed, 0, $outputlangs), - $array_key.'_already_payed'=>$alreadypayed, - $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed) + $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs), + $array_key.'_already_payed'=>price2num($sumpayed), + $array_key.'_already_deposit_locale'=>price($sumdeposit, 0, $outputlangs), + $array_key.'_already_deposit'=>price2num($sumdeposit), + $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs), + $array_key.'_already_creditnote'=>price2num($sumcreditnote), + + $array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs), + $array_key.'already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'), + + // Remain to pay with all know infrmation (except open direct debit requests) + $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs), + $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT') ); // Add vat by rates diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 4d9fa7a72af..2e2a26dd9ae 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -91,8 +91,8 @@ abstract class CommonInvoice extends CommonObject /** - * Return remain amount to pay. - * Property ->id and ->total_ttc must be set. + * Return remain amount to pay. Property ->id and ->total_ttc must be set. + * This does not include open direct debit requests. * * @param int $multicurrency Return multicurrency_amount instead of amount * @return int Remain of amount to pay @@ -549,6 +549,12 @@ abstract class CommonInvoiceLine extends CommonObjectLine */ public $fk_product; + /** + * VAT code + * @var string + */ + public $vat_src_code; + /** * VAT % * @var float diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 16bff11b5fd..947d99af545 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2790,6 +2790,8 @@ abstract class CommonObject { global $user,$langs,$conf; + $savElementId=$elementId; // To be used later to know if we were using the method using the id of this or not. + $elementId = (!empty($elementId)?$elementId:$this->id); $elementTable = (!empty($elementType)?$elementType:$this->table_element); @@ -2813,11 +2815,13 @@ abstract class CommonObject $error = 0; $trigkey=''; - if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; + if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_SIGN'; // 2 = SupplierProposal::STATUS_SIGNED. Can't use constant into this generic class + if ($this->element == 'supplier_proposal' && $status == 3) $trigkey='SUPPLIER_PROPOSAL_REFUSE'; // 3 = SupplierProposal::STATUS_REFUSED. Can't use constant into this generic class + if ($this->element == 'supplier_proposal' && $status == 4) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; // 4 = SupplierProposal::STATUS_CLOSED. Can't use constant into this generic class if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE'; if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; - + if ($trigkey) { // Appel des triggers @@ -2833,12 +2837,14 @@ abstract class CommonObject if (! $error) { $this->db->commit(); - if (empty($elementId)) // If the element we update was $this (so $elementId is null) + + if (empty($savElementId)) // If the element we update was $this (so $elementId is null) { $this->statut = $status; $this->status = $status; } - return 1; + + return 1; } else { @@ -3034,12 +3040,12 @@ abstract class CommonObject */ function getTotalWeightVolume() { - $weightUnit=0; - $volumeUnit=0; - $totalWeight = ''; - $totalVolume = ''; - $totalOrdered = ''; // defined for shipment only - $totalToShip = ''; // defined for shipment only + $totalWeight = 0; + $totalVolume = 0; + // defined for shipment only + $totalOrdered = ''; + // defined for shipment only + $totalToShip = ''; foreach ($this->lines as $line) { @@ -3054,11 +3060,18 @@ abstract class CommonObject $totalToShip+=$line->qty_shipped; // defined for shipment only } - // Define qty, weight, volume, weight_units, volume_units - if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments - else $qty=$line->qty; - $weight=$line->weight; - $volume=$line->volume; + // Define qty, weight, volume, weight_units, volume_units + if ($this->element == 'shipping') { + // for shipments + $qty = $line->qty_shipped ? $line->qty_shipped : 0; + } + else { + $qty = $line->qty ? $line->qty : 0; + } + + $weight = $line->weight ? $line->weight : 0; + $volume = $line->volume ? $line->volume : 0; + $weight_units=$line->weight_units; $volume_units=$line->volume_units; @@ -3560,7 +3573,7 @@ abstract class CommonObject print '
    '.$langs->trans('Ref').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('VATRate').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHTCurrency').''.$langs->trans('Qty').''; print $langs->trans("ActionsToDoBy").'   '; print ''; - print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); + print $form->select_dolusers($filtert, 'filtert', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").'   '; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); print '
    '; print ''; print ''; - print ''; + + print ''; + if (! empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) // Not tested ! + { + print $langs->trans("BuyingPrice").': '; + } + else + { + print ''; + } + // hidden fields for js function print ''; print ''; @@ -544,11 +552,22 @@ if ($id > 0 || ! empty($ref)) { print '' . img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'onClick="addDispatchLine(' . $i . ',\'' . $type . '\')"') . '
    '; print ''; print ''; - print ''; + + print ''; + if (! empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) // Not tested ! + { + print $langs->trans("BuyingPrice").': '; + } + else + { + print ''; + } + // hidden fields for js function print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 04af9470e6d..f930ad87979 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -70,7 +70,7 @@ $projectid = GETPOST('projectid','int'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOST('originid', 'int'); -//PDF +// PDF $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); @@ -1194,32 +1194,11 @@ if (empty($reshook)) $trackid='sin'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - - // Build document - if ($action == 'builddoc') - { - // Save modele used - $object->fetch($id); - $object->fetch_thirdparty(); - - // Save last template used to generate document - if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); - - $outputlangs = $langs; - $newlang=GETPOST('lang_id','alpha'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $action=''; - } - } + // Actions to build doc + $upload_dir = $conf->fournisseur->facture->dir_output; + $permissioncreate = $user->rights->fournisseur->facture->creer; + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + // Make calculation according to calculationrule if ($action == 'calculate') { @@ -1234,22 +1213,6 @@ if (empty($reshook)) exit; } } - // Delete file in doc form - if ($action == 'remove_file') - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - if ($object->fetch($id)) - { - $object->fetch_thirdparty(); - $upload_dir = $conf->fournisseur->facture->dir_output . "/"; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); - } - } - if ($action == 'update_extras') { // Fill array 'array_options' with data from add form @@ -1924,7 +1887,7 @@ else $head = facturefourn_prepare_head($object); $titre=$langs->trans('SupplierInvoice'); - dol_fiche_head($head, 'card', $titre, 0, 'bill'); + dol_fiche_head($head, 'card', $titre, -1, 'bill'); // Clone confirmation if ($action == 'clone') @@ -2792,8 +2755,8 @@ else * Documents generes */ $ref=dol_sanitizeFileName($object->ref); - $subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref; - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref; + $subdir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$ref; + $filedir = $conf->fournisseur->facture->dir_output.'/'.$subdir; $urlsource=$_SERVER['PHP_SELF'].'?id='.$object->id; $genallowed=$user->rights->fournisseur->facture->creer; $delallowed=$user->rights->fournisseur->facture->supprimer; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index cafc6c1a496..0f56c5f7bae 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -138,7 +138,7 @@ if ($id > 0 || ! empty($ref)) $head = facturefourn_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), 0, 'bill'); + dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill'); $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 2563a176346..ab56a66d8a7 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -89,7 +89,7 @@ llxHeader('', $title, $helpurl); if ($object->id > 0) { $head = facturefourn_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), 0, 'bill'); + dol_fiche_head($head, 'documents', $langs->trans('SupplierInvoice'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); @@ -230,6 +230,8 @@ if ($object->id > 0) print '

    '; + print '
    '; + print ''; // Nb of files diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index af98c4f9b66..f5ab9164042 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -59,7 +59,7 @@ $alreadypaid=$object->getSommePaiement(); $head = facturefourn_prepare_head($object); $titre=$langs->trans('SupplierInvoice'); -dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), 0, 'bill'); +dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill'); $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index cd009e394f6..9df425040e1 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -79,11 +79,9 @@ if ($object->id > 0) $head = facturefourn_prepare_head($object); $titre=$langs->trans('SupplierInvoice'); - dol_fiche_head($head, 'note', $titre, 0, 'bill'); + dol_fiche_head($head, 'note', $titre, -1, 'bill'); - print '
    '; - // Supplier invoice card $linkback = ''.$langs->trans("BackToList").''; @@ -135,7 +133,9 @@ if ($object->id > 0) print '
    '; print '
    '; - // Type + print '
    '; + + // Type print '\n"; //print "\n"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 182268a5f06..6ad747a7694 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -29,18 +29,52 @@ $langs->load("admin"); $langs->load("modulebuilder"); $langs->load("other"); +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$module=GETPOST('module'); +$tab=GETPOST('tab'); +if (empty($module)) $module='initmodule'; +if (empty($tab)) $tab='description'; + + // Security check if (! $user->admin && empty($conf->global->MODULEBUILDER_FOREVERYONE)) accessforbidden('ModuleBuilderNotAllowed'); +$modulename=dol_sanitizeFileName(GETPOST('modulename','alpha')); + +// Dir for custom dirs +$tmp=explode(',', $dolibarr_main_document_root_alt); +$dircustom = $tmp[0]; + +$FILEFLAG='modulebuilder.txt'; + + +/* + * Actions + */ + +if ($dircustom && $action == 'initmodule' && $modulename) +{ + $srcfile = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $destfile = $dircustom.'/'.$modulename; + $result = dolCopyDir($srcfile, $destfile, 0, 0); + //dol_mkdir($destfile); + + if ($result > 0) + { + setEventMessages('ModuleInitialized', null); + } + else + { + setEventMessages($langs->trans("ErrorFailedToCopyDir"), null, 'errors'); + } +} /* * View */ -$socstatic=new Societe($db); - - llxHeader("",$langs->trans("ModuleBuilder"),""); @@ -48,14 +82,7 @@ $text=$langs->trans("ModuleBuilder"); print load_fiche_titre($text, '', 'title_setup'); -$tmp=explode(',', $dolibarr_main_document_root_alt); -$dircustom = $tmp[0]; - -// Show description of content -print $langs->trans("ModuleBuilderDesc", $dircustom).'

    '; - - - +$listofmodules=array(); /* if (!empty($conf->modulebuilder->enabled) && $mainmenu == 'modulebuilder') // Entry for Module builder { @@ -64,16 +91,16 @@ if (!empty($conf->modulebuilder->enabled) && $mainmenu == 'modulebuilder') // En { foreach ($dolibarr_main_document_root_alt as $diralt) {*/ - $dirsincustom=dol_dir_list($dircustom); + $dirsincustom=dol_dir_list($dircustom, 'directories'); if (is_array($dirsincustom) && count($dirsincustom) > 0) { - foreach ($dirsincustom as $dircustom) + foreach ($dirsincustom as $dircustomcursor) { - $fullname = $dircustom['fullname']; - if (dol_is_file($fullname.'/modulebuilder.txt')) + $fullname = $dircustomcursor['fullname']; + if (dol_is_file($fullname.'/'.$FILEFLAG)) { - print '
    '.$module.'
    '; + $listofmodules[$dircustomcursor['name']]=$fullname; } } } @@ -84,6 +111,123 @@ if (!empty($conf->modulebuilder->enabled) && $mainmenu == 'modulebuilder') // En $newmenu->add('', 'NoGeneratedModuleFound', 0, 0); }*/ + +// Show description of content +print $langs->trans("ModuleBuilderDesc").'
    '; +print $langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $dircustom).'
    '; +print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'
    '; +print '
    '; + + +print '
    '; + +$head = array(); +$h=0; + +$head[$h][0] = $_SERVER["PHP_SELF"].'?module=initmodule'; +$head[$h][1] = $langs->trans("NewModule"); +$head[$h][2] = 'initmodule'; +$h++; + +foreach($listofmodules as $tmpmodule => $fullname) +{ + $head[$h][0] = $_SERVER["PHP_SELF"].'?module='.$tmpmodule; + $head[$h][1] = $tmpmodule; + $head[$h][2] = $tmpmodule; + $h++; +} + + + +dol_fiche_head($head, $module, $langs->trans("Modules"), -1, 'generic'); + +if ($module == 'initmodule') +{ + // New module + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; +} +elseif (! empty($module)) +{ + $error=0; + + // Load module + dol_include_once($module.'/core/modules/mod'.ucfirst($module).'.class.php'); + $class='mod'.ucfirst($module); + if (class_exists($class)) + { + try { + $moduleobj = new $class($db); + } + catch(Exception $e) + { + $error++; + print $e->getMessage(); + } + } + else + { + $error++; + $langs->load("errors"); + print img_warning('').' '.$langs->trans("ErrorFailedToLoadModuleDescriptorForXXX", $module); + } + + // Button to delete module + + + // Tabs for module + if (! $error) + { + $head2 = array(); + $h=0; + + foreach($listofmodules as $tmpmodule => $fullname) + { + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description'; + $head2[$h][1] = $langs->trans("Description"); + $head2[$h][2] = 'description'; + $h++; + + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects'; + $head2[$h][1] = $langs->trans("Objects"); + $head2[$h][2] = 'objects'; + $h++; + + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab='.$tmpmodule; + $head2[$h][1] = $langs->trans("Menus"); + $head2[$h][2] = 'menus'; + $h++; + + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab='.$tmpmodule; + $head2[$h][1] = $langs->trans("Permissions"); + $head2[$h][2] = 'permissions'; + $h++; + + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab='.$tmpmodule; + $head2[$h][1] = $langs->trans("Triggers"); + $head2[$h][2] = 'triggers'; + $h++; + } + + dol_fiche_head($head2, $tab, '', -1, ''); + + print $moduleobj->getDescLong(); + + + + + + dol_fiche_end(); + } +} + +dol_fiche_end(); + llxFooter(); diff --git a/htdocs/modulebuilder/template/.editorconfig b/htdocs/modulebuilder/template/.editorconfig new file mode 100644 index 00000000000..2df455f0d4f --- /dev/null +++ b/htdocs/modulebuilder/template/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +[*.php] +indent_style = tab +[*.js] +indent_style = tab +[*.css] +indent_style = tab +[*.xml] +indent_style = tab +[*.md] +trim_trailing_whitespace = false diff --git a/htdocs/modulebuilder/template/.gitattributes b/htdocs/modulebuilder/template/.gitattributes new file mode 100644 index 00000000000..58065c729fc --- /dev/null +++ b/htdocs/modulebuilder/template/.gitattributes @@ -0,0 +1,23 @@ +# Set default behaviour, in case users don't have core.autocrlf set. +* text=auto + + +# Explicitly declare text files we want to always be normalized and converted +# to native line endings on checkout. +*.php text eol=lf +*.sql text eol=lf +*.htm text eol=lf +*.html text eol=lf +*.js text eol=lf +*.css text eol=lf +*.lang text eol=lf +*.txt text eol=lf +*.md text eol=lf +*.bat text eol=crlf + +# Denote all files that are truly binary and should not be modified. +*.ico binary +*.png binary +*.jpg binary +*.odt binary +*.odf binary diff --git a/htdocs/modulebuilder/template/.gitignore b/htdocs/modulebuilder/template/.gitignore new file mode 100644 index 00000000000..e950cee245d --- /dev/null +++ b/htdocs/modulebuilder/template/.gitignore @@ -0,0 +1,16 @@ +# Generated binaries +/build/*.zip +# Doxygen generated documentation +/build/doxygen/doxygen_warnings.log +/doc/code/doxygen +# Composer managed dependencies +/vendor +/dev/bin +# PHPdocumentor generated files +/build/phpdoc +/doc/code/phpdoc +# Sphinx generated files +/doc/user/build +/.settings/ +/.buildpath +/.project \ No newline at end of file diff --git a/htdocs/modulebuilder/template/.tx/config b/htdocs/modulebuilder/template/.tx/config new file mode 100644 index 00000000000..1743c5d00dd --- /dev/null +++ b/htdocs/modulebuilder/template/.tx/config @@ -0,0 +1,9 @@ +[main] +host = https://www.transifex.com +lang_map = uz: uz_UZ + +[mymodule.mymodule] +file_filter = langs//mymodule.lang +source_file = langs/en_US/mymodule.lang +source_lang = en_US +type = MOZILLAPROPERTIES diff --git a/htdocs/modulebuilder/template/COPYING b/htdocs/modulebuilder/template/COPYING new file mode 100644 index 00000000000..94a04532226 --- /dev/null +++ b/htdocs/modulebuilder/template/COPYING @@ -0,0 +1,621 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md new file mode 100644 index 00000000000..5e2af06a430 --- /dev/null +++ b/htdocs/modulebuilder/template/README.md @@ -0,0 +1,221 @@ +Dolibarr Module Template (aka My Module) +======================================== + +This is a full featured module template for Dolibarr. +It's a tool for module developers to kickstart their project and give an hands-on sample of which features Dolibarr has to offer for module development. + +If you're not a module developer you have no use for this. + +Documentation +------------- + +[Module tutorial](http://wiki.dolibarr.org/index.php/Module_development) + +[Dolibarr development](http://wiki.dolibarr.org/index.php/Developer_documentation) + +### Translations + +Dolibarr uses [Transifex](http://transifex.com) to manage it's translations. + +This template also contains a sample configuration for Transifex managed translations under the hidden [.tx](.tx) directory. + +For more informations, see the [translator's documentation](http://wiki.dolibarr.org/index.php/Translator_documentation). + +There is a [Transifex project](http://transifex.com/projects/p/dolibarr-module-template) for this module. + +Install +------- + +### Manually + +- Make sure Dolibarr (>= 3.3.x) is already installed and configured on your workstation or development server. + +- In your Dolibarr installation directory, edit the ```htdocs/conf/conf.php``` file + +- Find the following lines: + ```php + //$dolibarr_main_url_root_alt ... + //$dolibarr_main_document_root_alt ... + ``` + +- Uncomment these lines (delete the leading ```//```) and assign a sensible value according to your Dolibarr installation + + For example : + + - UNIX: + ```php + $dolibarr_main_url_root = 'http://localhost/Dolibarr/htdocs'; + $dolibarr_main_document_root = '/var/www/Dolibarr/htdocs'; + $dolibarr_main_url_root_alt = '/custom'; + $dolibarr_main_document_root_alt = '/var/www/Dolibarr/htdocs/custom'; + ``` + + - Windows: + ```php + $dolibarr_main_url_root = 'http://localhost/Dolibarr/htdocs'; + $dolibarr_main_document_root = 'C:/My Web Sites/Dolibarr/htdocs'; + $dolibarr_main_url_root_alt = '/custom'; + $dolibarr_main_document_root_alt = 'C:/My Web Sites/Dolibarr/htdocs/custom'; + ``` + + For more information about the ```conf.php``` file take a look at the conf.php.example file. + +*Note that for Dolibarr versions before 3.5, the ```$dolibarr_main_url_root_alt``` has to be an absolute path* + +- Clone the repository in ```$dolibarr_main_document_root_alt/mymodule``` + +*(You may have to create the ```htdocs/custom``` directory first if it doesn't exist yet.)* +```sh +git clone git@github.com:Dolibarr/dolibarr-module-template.git mymodule +``` + +- Install [Composer](https://getcomposer.org) dependencies: +```sh +composer install +``` + +Follow the [final steps](#final_steps). + +### Using [Composer](https://getcomposer.org) +Require this repository from Dolibarr's composer: +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/dolibarr/dolibarr-module-template" + } + ], + "require": { + "dolibarr/mymodule": "dev-master" + } +} +``` + +Run +```sh +composer update +``` + +Follow the [final steps](#final_steps). + +### Final steps + +From your browser: + + - Log into Dolibarr as a super-administrator + - Under "Setup" -> "Other setup", set ```MAIN_FEATURES_LEVEL``` to ```2``` + - Go to "Setup" -> "Modules" + - The module is under one of the tabs + - You should now be able to enable the new module and start coding ;) + +Provided tools +-------------- + +### Starting a new module + +A [script](dev/newmodule.sh) allows you to rename most of the code to your own module name. +It requires ```find```, ```sed``` and ```rename``` commands on your system. +Just make sure you provide a CamelCase name. +```sh +./dev/newmodule.sh [NewName] +``` + +Some work still has to be done manually: +- Rename the directory holding the code +- Maybe rename some other bits (Search for 'my' in filenames and code) +- Update your module ID in the module descriptor +- Update your language files + - Keywords based on the module ID + - String referencing the template +- Remove the features you don't plan to use +- Fill the copyright notices at the top of each file +- Add your logo: see [images README](dev/img/README.md) for specifications +- Start a new GIT history +``` +git checkout --orphan [new_branch_name] +``` +- Build an awesome module ;) + +### Composer scripts + +Only the main commands are listed here. +See the [composer comments](composer-comments.md) or the [composer.json](composer.json) itself for more informations. + +#### Check + +Run a linter, a PHP compatibility version checker and checks coding style. +```sh +composer check +``` + +#### Test + +Run unit and functional tests. +```sh +composer test +``` + +#### Doc +Build code and user documentation. + +#### Release + +Run the checks and tests then build a distribution ZIP. +```sh +composer release +``` + +#### Git hooks + +Optional [GIT hooks](https://git-scm.com/book/it/v2/Customizing-Git-Git-Hooks) are provided. +These are just wrappers calling composer scripts. +They ensure best practices are followed during module development. + +Install: +```sh +composer git_hooks_install +``` + +Remove: +```sh +composer git_hooks_remove +``` + +## Publishing the module +The de-facto standard for publishing and marketing modules for Dolibarr is the [Dolistore](https://www.dolistore.com). +Templates for required images and texts are [provided](dev/dolistore). +Check the dedicated [README](dev/dolistore/README.md) for more informations. + +Contributions +------------- + +Feel free to contribute and report defects on our [issue tracker](http://github.com/Dolibarr/dolibarr-module-template/issues). + +Licenses +-------- + +### Main code + +![GPLv3 logo](img/gplv3.png) + +GPLv3 or (at your option) any later version. + +See [COPYING](COPYING) for more information. + +### Other Licenses + +#### [Parsedown](http://parsedown.org/) + +Used to display this README in the module's about page. +Licensed under MIT. + +#### [GNU Licenses logos](https://www.gnu.org/graphics/license-logos.html) + +Public domain + +#### Documentation + +All texts and readmes. + +![GFDL logo](img/gfdl.png) diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php new file mode 100644 index 00000000000..6953af2ef38 --- /dev/null +++ b/htdocs/modulebuilder/template/admin/about.php @@ -0,0 +1,94 @@ + + * Copyright (C) + * + * 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 admin/about.php + * \ingroup mymodule + * \brief About page of module MyModule. + * + * MyModuleDescription. + */ + +// Load Dolibarr environment +if (false === (@include '../../main.inc.php')) { // From htdocs directory + require '../../../main.inc.php'; // From "custom" directory +} + +// Libraries +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once '../lib/mymodule.lib.php'; + +// Translations +$langs->load("errors"); +$langs->load("admin"); +$langs->load("mymodule@mymodule"); + +// Access control +if (! $user->admin) { + accessforbidden(); +} + +// Parameters +$action = GETPOST('action', 'alpha'); + + +/* + * Actions + */ + +// None + + +/* + * View + */ + +$form = new Form($db); + +$page_name = "MyModuleAbout"; +llxHeader('', $langs->trans($page_name)); + +// Subheader +$linkback = '' + . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans($page_name), $linkback); + +// Configuration header +$head = mymoduleAdminPrepareHead(); +dol_fiche_head( + $head, + 'about', + $langs->trans("MyModuleName"), + 0, + 'mymodule@mymodule' +); + +// About page goes here +echo $langs->trans("MyModuleAboutPage"); + +echo '
    '; + +require_once '../core/modulebuilder/mymodule/core/modules/modMyModule.class.php'; +$tmpmodule = new MyModule($db); +print $tmpmodule->getDescLong(); + +// Page end +dol_fiche_end(); +llxFooter(); +$db->close(); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php new file mode 100644 index 00000000000..8bc2c6d9ded --- /dev/null +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -0,0 +1,79 @@ + + * Copyright (C) + * + * 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 admin/setup.php + * \ingroup mymodule + * \brief Example module setup page. + * + * Put detailed description here. + */ + +// Load Dolibarr environment +if (false === (@include '../../main.inc.php')) { // From htdocs directory + require '../../../main.inc.php'; // From "custom" directory +} + +global $langs, $user; + +// Libraries +require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; +require_once '../lib/mymodule.lib.php'; +//require_once "../class/myclass.class.php"; +// Translations +$langs->load("mymodule@mymodule"); + +// Access control +if (! $user->admin) { + accessforbidden(); +} + +// Parameters +$action = GETPOST('action', 'alpha'); + +/* + * Actions + */ + +/* + * View + */ +$page_name = "MyModuleSetup"; +llxHeader('', $langs->trans($page_name)); + +// Subheader +$linkback = '' + . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans($page_name), $linkback); + +// Configuration header +$head = mymoduleAdminPrepareHead(); +dol_fiche_head( + $head, + 'settings', + $langs->trans("Module500000Name"), + 0, + "mymodule@mymodule" +); + +// Setup page goes here +echo $langs->trans("MyModuleSetupPage"); + +// Page end +dol_fiche_end(); +llxFooter(); diff --git a/htdocs/modulebuilder/template/build/doxygen/mymodule.doxyfile b/htdocs/modulebuilder/template/build/doxygen/mymodule.doxyfile new file mode 100644 index 00000000000..0b4e079a385 --- /dev/null +++ b/htdocs/modulebuilder/template/build/doxygen/mymodule.doxyfile @@ -0,0 +1,2419 @@ +# Doxyfile 1.8.12 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = mymodule + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = development + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = My module brief. + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = ../../img/mymodule.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../../doc/code/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = YES + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = NO + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = "../.." + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = YES + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = doxygen_warnings.log + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../.. + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.php \ + *.pl + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = ../../build \ + ../../dev \ + ../../doc \ + ../../vendor + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = YES + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = *.php + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = ../../doc/images + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = ./ + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.dolibarr.doc + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Dolibarrteam + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = YES + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /
    '.$langs->trans('Type').''; print $object->getLibType(); if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) @@ -203,6 +203,7 @@ if ($object->id > 0) print '
    '; + print '
    '; $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index d9c5fdf43c0..d35fa9293c3 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -202,7 +202,7 @@ $user_id = $user->id; if ($id > 0) { // Charge utilisateur edite - $fuser->fetch($id); + $fuser->fetch($id, '', '', 1); $fuser->getrights(); $user_id = $fuser->id; } @@ -282,6 +282,7 @@ print ''; print ''; print ''; print ''; +if ($id > 0) print ''; if ($sall) { diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index 81e9dad9f97..40668215647 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -1,14 +1,16 @@ xmlParsed; } + /** * Function to replace macros for invoice short and long month, invoice year * @@ -177,10 +182,11 @@ class Segment implements IteratorAggregate, Countable return $text; } + /** * Analyse the XML code in order to find children * - * @param string $xml + * @param string $xml Xml * @return Segment */ protected function _analyseChildren($xml) @@ -197,11 +203,14 @@ class Segment implements IteratorAggregate, Countable } return $this; } + /** * Assign a template variable to replace * - * @param string $key - * @param string $value + * @param string $key Key + * @param string $value Value + * @param string $encode Encode + * @param string $charset Charset * @throws SegmentException * @return Segment */ @@ -255,7 +264,7 @@ IMG; /** * Shortcut to retrieve a child * - * @param string $prop + * @param string $prop Prop * @return Segment * @throws SegmentException */ @@ -270,8 +279,8 @@ IMG; /** * Proxy for setVars * - * @param string $meth - * @param array $args + * @param string $meth Meth + * @param array $args Args * @return Segment */ public function __call($meth, $args) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index d052482845c..01633634705 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -1,16 +1,20 @@ {aaa} // instead of {aaa} so we should enhance this function. //print $key.'-'.$value.'-'.strpos($this->contentXml, $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT']).'
    '; - if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml , $tag) === false) { + if (strpos($this->contentXml, $tag) === false && strpos($this->stylesXml, $tag) === false) { //if (strpos($this->contentXml, '">'. $key . '') === false) { throw new OdfException("var $key not found in the document"); //} @@ -577,6 +583,7 @@ IMG; } else { + dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING); $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($name).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF); } @@ -642,7 +649,8 @@ IMG; /** * Returns a variable of configuration * - * @return string The requested variable of configuration + * @param string $configKey Config key + * @return string The requested variable of configuration */ public function getConfig($configKey) { @@ -678,7 +686,8 @@ IMG; /** * Empty the temporary working directory recursively - * @param $dir the temporary working directory + * + * @param string $dir The temporary working directory * @return void */ private function _rrmdir($dir) @@ -701,8 +710,8 @@ 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 $valuename Balise in the template + * @return string The value inside the balise */ public function getvalue($valuename) { diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 5f0e8dd5416..e81d13dd2b8 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -27,15 +27,11 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -delete from llx_accounting_account; -delete from llx_accounting_system; -delete from llx_accounting_journal; - -INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (1,'VT', 'Journal des ventes', 1, 1); -INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (2,'AC', 'Journal des achats', 2, 1); -INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (3,'BQ', 'Journal de banque', 3, 1); -INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (4,'OD', 'Journal des opérations diverses', 0, 1); -INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Journal des à-nouveaux', 9, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('VT', 'Journal des ventes', 2, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('AC', 'Journal des achats', 3, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('BQ', 'Journal de banque', 4, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('OD', 'Journal des opérations diverses', 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('AN', 'Journal des à-nouveaux', 9, 1); -- -- Descriptif des plans comptables FR PCG99-ABREGE -- diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index f52802dc356..1b2cabb573d 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -263,3 +263,4 @@ ALTER TABLE llx_product_price ALTER COLUMN date_price SET DEFAULT NULL; ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx; ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx; +ALTER TABLE llx_events MODIFY COLUMN ip varchar(250); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index 1982ef6aff8..d96210dcbfe 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -120,6 +120,8 @@ INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES ( INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (4,'OD', 'Journal des opérations diverses', 0, 1); INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Journal des à-nouveaux', 9, 1); +ALTER TABLE llx_accounting_journal ADD COLUMN entity integer DEFAULT 1; + ALTER TABLE llx_paiementfourn ADD COLUMN model_pdf varchar(255); @@ -248,3 +250,13 @@ insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); + +ALTER TABLE llx_events MODIFY COLUMN ip varchar(250); + +UPDATE llx_accounting_journal SET nature = 1 where code = 'OD' and nature = 0; +UPDATE llx_accounting_journal SET nature = 2 where code = 'VT' and nature = 1; +UPDATE llx_accounting_journal SET nature = 3 where code = 'AC' and nature = 2; +UPDATE llx_accounting_journal SET nature = 4 where (code = 'BK' or code = 'BQ') and nature = 3; + + + diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 32696ecf593..6ff7356847f 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -306,6 +306,18 @@ DELETE FROM llx_c_shipment_mode where code IN (select code from tmp_c_shipment_m drop table tmp_c_shipment_mode; +-- Clean product prices +--delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05'; +-- Set product prices into llx_product with last price into llx_product_prices +--update llx_product as p set +-- p.price = (select pp.price from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1), +-- p.price_ttc = (select pp.price_ttc from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1), +-- p.price_min = (select pp.price_min from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1), +-- p.price_min_ttc = (select pp.price_min_ttc from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1), +-- p.tva_tx = 0 +-- where price = 17.5 + + -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; -- VMYSQL4.1 update llx_expensereport set date_debut = date_create where DATE(STR_TO_DATE(date_debut, '%Y-%m-%d')) IS NULL; -- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; @@ -324,3 +336,4 @@ drop table tmp_c_shipment_mode; -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; -- VMYSQL4.1 update llx_expensereport_det as ed set date = (select date_debut from llx_expensereport as e where ed.fk_expensereport = e.rowid) where DATE(STR_TO_DATE(date, '%Y-%m-%d')) < '1000-00-00'; -- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; + diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.sql b/htdocs/install/mysql/tables/llx_accounting_journal.sql index d9c6ea76e3e..a435de3cd80 100644 --- a/htdocs/install/mysql/tables/llx_accounting_journal.sql +++ b/htdocs/install/mysql/tables/llx_accounting_journal.sql @@ -20,8 +20,9 @@ create table llx_accounting_journal ( rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, code varchar(32) NOT NULL, label varchar(128) NOT NULL, - nature smallint DEFAULT 0 NOT NULL, -- type of journals (0:various operations / 1:sale / 2:purchase / 3:bank / 9: has-new) + nature smallint DEFAULT 0 NOT NULL, -- type of journals (1:various operations / 2:sale / 3:purchase / 4:bank / 9: has-new) active smallint DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_events.sql b/htdocs/install/mysql/tables/llx_events.sql index 29a369269c3..c153522cb09 100644 --- a/htdocs/install/mysql/tables/llx_events.sql +++ b/htdocs/install/mysql/tables/llx_events.sql @@ -30,7 +30,7 @@ create table llx_events dateevent datetime, -- date event fk_user integer, -- id user description varchar(250) NOT NULL, -- full description of action - ip varchar(32) NOT NULL, -- ip + ip varchar(250) NOT NULL, -- ip (must contains ip v4 and v6 or dns names) user_agent varchar(255) NULL, -- user agent fk_object integer -- id of related object ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql index b3e2001f9c3..926a05a738e 100644 --- a/htdocs/install/mysql/tables/llx_fichinter.sql +++ b/htdocs/install/mysql/tables/llx_fichinter.sql @@ -43,5 +43,4 @@ create table llx_fichinter note_public text, model_pdf varchar(255), extraparams varchar(255) -- for stock other parameters with json format - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_inventory.sql b/htdocs/install/mysql/tables/llx_inventory.sql index f906699f5dd..ce1a2c93744 100644 --- a/htdocs/install/mysql/tables/llx_inventory.sql +++ b/htdocs/install/mysql/tables/llx_inventory.sql @@ -1,6 +1,6 @@ -- =================================================================== --- Copyright (C) 2012 Laurent Destailleur --- Copyright (C) 2017 ATM Consulting +-- Copyright (C) 2017 Laurent Destailleur +-- Copyright (C) 2017 ATM Consulting -- -- 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 @@ -19,13 +19,18 @@ CREATE TABLE llx_inventory ( -rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -datec datetime DEFAULT NULL, -tms timestamp, -fk_warehouse integer DEFAULT 0, -entity integer DEFAULT 0, -status integer DEFAULT 0, -title varchar(255) NOT NULL, -date_inventory datetime DEFAULT NULL + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0, + ref varchar(48), + datec datetime DEFAULT NULL, + tms timestamp, + fk_user_author integer, -- user making creation + fk_user_modif integer, -- user making last change + fk_user_valid integer, -- valideur de la fiche + fk_warehouse integer DEFAULT 0, + status integer DEFAULT 0, + title varchar(255) NOT NULL, + date_inventory datetime DEFAULT NULL, + import_key varchar(14) -- import key ) ENGINE=InnoDB; diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal.sql b/htdocs/install/mysql/tables/llx_supplier_proposal.sql index 43f26ee0459..13d9ba3a59a 100644 --- a/htdocs/install/mysql/tables/llx_supplier_proposal.sql +++ b/htdocs/install/mysql/tables/llx_supplier_proposal.sql @@ -18,7 +18,7 @@ CREATE TABLE llx_supplier_proposal ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, ref varchar(30) NOT NULL, - entity integer NOT NULL DEFAULT '1', + entity integer NOT NULL DEFAULT 1, ref_ext varchar(255) DEFAULT NULL, ref_int varchar(255) DEFAULT NULL, fk_soc integer DEFAULT NULL, @@ -31,11 +31,11 @@ CREATE TABLE llx_supplier_proposal ( fk_user_modif integer DEFAULT NULL, fk_user_valid integer DEFAULT NULL, fk_user_cloture integer DEFAULT NULL, - fk_statut smallint NOT NULL DEFAULT '0', -- 0=draft, 1=validated, 2=accepted, 3=refused, 4=closed - price double DEFAULT '0', - remise_percent double DEFAULT '0', - remise_absolue double DEFAULT '0', - remise double DEFAULT '0', + fk_statut smallint DEFAULT 0 NOT NULL, -- 0=draft, 1=validated, 2=accepted, 3=refused, 4=billed/closed + price double DEFAULT 0, + remise_percent double DEFAULT 0, + remise_absolue double DEFAULT 0, + remise double DEFAULT 0, total_ht double(24,8) DEFAULT 0, tva double(24,8) DEFAULT 0, localtax1 double(24,8) DEFAULT 0, diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index bd1e41c5464..9eb4135397f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -32,23 +32,25 @@ ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account AccountancyArea=Accountancy area AccountancyAreaDescIntro=Usage of the accountancy module is done in several step: AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year... -AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making thee journalization (writing record in Journals and General ledger) +AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger) AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies... + +AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from menu %s AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s -AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this you can use the menu entry %s. -AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for type of expense report. For this you can use the menu entry %s. -AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this you can use the menu entry %s. -AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expences (miscellaneous taxes). For this you can use the menu entry %s. -AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this you can use the menu entry %s. -AccountancyAreaDescMisc=STEP %s: Define default accounting accounts for miscellaneous transactions. For this you can use the menu entry %s. -AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this you can use the menu entry %s. -AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s. -AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products. For this you can use the menu entry %s. -AccountancyAreaDescCustomer=STEP %s: Check the binding between existing customer invoice lines and accounting account is done, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. For this you can use the menu entry %s. -AccountancyAreaDescSupplier=STEP %s: Check the binding between existing supplier invoice lines and accounting account is done, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. For this you can use the menu entry %s. -AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the General Ledger. For this, go into each Journal, and click into button "Journalize transactions in General Ledger". +AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s. +AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s. +AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s. +AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expences (miscellaneous taxes). For this, use the menu entry %s. +AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s. +AccountancyAreaDescMisc=STEP %s: Define default accounting accounts for miscellaneous transactions. For this, use the menu entry %s. +AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s. +AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s. +AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s. + +AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in General Ledger in one click. Complete missing bindings. For this, use the menu entry %s. +AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the General Ledger. For this, go into menu %s, and click into button %s. AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and generate reports and exports. AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future. @@ -59,6 +61,7 @@ ChangeAndLoad=Change and load Addanaccount=Add an accounting account AccountAccounting=Accounting account AccountAccountingShort=Account +ShowAccoutingAccount=Show accounting account AccountAccountingSuggest=Accounting account suggested MenuDefaultAccounts=Default accounts MenuVatAccounts=Vat accounts @@ -204,11 +207,11 @@ NewAccountingJournal=New accounting journal ShowAccoutingJournal=Show accounting journal Code=Code Nature=Nature -AccountingJournalTypeVariousOperation=Various operation -AccountingJournalTypeSale=Sale -AccountingJournalTypePurchase=Purchase -AccountingJournalTypeBank=Bank -AccountingJournalTypeHasNew=Has-new +AccountingJournalType1=Various operation +AccountingJournalType2=Sales +AccountingJournalType3=Purchases +AccountingJournalType4=Bank +AccountingJournalType9=Has-new ErrorAccountingJournalIsAlreadyUse=This journal is already use ## Export @@ -225,6 +228,7 @@ Modelcsv_ciel=Export towards Sage Ciel Compta or Compta Evolution Modelcsv_quadratus=Export towards Quadratus QuadraCompta Modelcsv_ebp=Export towards EBP Modelcsv_cogilog=Export towards Cogilog +Modelcsv_agiris=Export towards Agiris (Test) ChartofaccountsId=Chart of accounts Id ## Tools - Init accounting account on product / service diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 35037387c1f..5fd5cb57c8b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -302,6 +302,8 @@ CurrentVersion=Dolibarr current version CallUpdatePage=Go to the page that updates the database structure and data: %s. LastStableVersion=Latest stable version LastActivationDate=Latest activation date +LastActivationAuthor=Latest activation author +LastActivationIP=Latest activation IP UpdateServerOffline=Update server offline WithCounter=Manage a counter GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used:
    {000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask.
    {000000+000} same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s.
    {000000@x} same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required.
    {dd} day (01 to 31).
    {mm} month (01 to 12).
    {yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
    @@ -431,9 +433,13 @@ TheKeyIsTheNameOfHtmlField=This is the name of the HTML field. This need to have PageUrlForDefaultValues=You must enter here the relative url of the page. If you include parameters in URL, the default values will be effective if all parameters are set to same value. Examples: PageUrlForDefaultValuesCreate=
    For form to create a new thirdparty, it is %s PageUrlForDefaultValuesList=
    For page that list thirdparties, it is %s +EnableDefaultValues=Enable usage of personalized default values GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code, so to change this value, you must edit it fom Home-Setup-translation. WarningSettingSortOrder=Warning, setting a default sort order may result in a technical error when going on the list page if field is an unknown field. If you experience such an error, come back to this page to remove the default sort order and restore default behavior. Field=Field +ProductDocumentTemplates=Document templates to generate product document +FreeLegalTextOnExpenseReports=Free legal text on expense reports +WatermarkOnDraftExpenseReports=Watermark on draft expense reports # Modules Module0Name=Users & groups Module0Desc=Users / Employees and Groups management @@ -856,6 +862,7 @@ DictionaryOrderMethods=Ordering methods DictionarySource=Origin of proposals/orders DictionaryAccountancyCategory=Accounting account groups DictionaryAccountancysystem=Models for chart of accounts +DictionaryAccountancyJournal=Accounting journals DictionaryEMailTemplates=Emails templates DictionaryUnits=Units DictionaryProspectStatus=Prospection status @@ -1094,7 +1101,7 @@ WarningAtLeastKeyOrTranslationRequired=A search criteria is required at least fo NewTranslationStringToShow=New translation string to show OriginalValueWas=The original translation is overwritten. Original value was:

    %s TransKeyWithoutOriginalValue=You forced a new translation for the translation key '%s' that does not exists in any language files -TotalNumberOfActivatedModules=Total number of activated feature modules: %s / %s +TotalNumberOfActivatedModules=Activated feature/modules: %s / %s YouMustEnableOneModule=You must at least enable 1 module ClassNotFoundIntoPathWarning=Class %s not found into PHP path YesInSummer=Yes in summer @@ -1151,6 +1158,7 @@ WebCalUrlForVCalExport=An export link to %s format is available at follow BillsSetup=Invoices module setup BillsNumberingModule=Invoices and credit notes numbering model BillsPDFModules=Invoice documents models +PaymentsPDFModules=Payment documents models CreditNote=Credit note CreditNotes=Credit notes ForceInvoiceDate=Force invoice date to validation date @@ -1347,9 +1355,10 @@ CacheByClient=Cache by browser CompressionOfResources=Compression of HTTP responses TestNotPossibleWithCurrentBrowsers=Such an automatic detection is not possible with current browsers DefaultValuesDesc=You can define/force here the default value you want to get when your create a new record, and/or defaut filters or sort order when your list record. -DefaultCreateForm=Create forms -DefaultSearchFilters=Search filters -DefaultSortOrder=Sort orders +DefaultCreateForm=Default values for new objects +DefaultSearchFilters=Default search filters +DefaultSortOrder=Default sort orders +DefaultFocus=Default focus fields ##### Products ##### ProductSetup=Products module setup ServiceSetup=Services module setup diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 01b69b3b839..76b1a92a365 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -58,11 +58,11 @@ CronStatusInactiveBtn=Disable CronTaskInactive=This job is disabled CronId=Id CronClassFile=Classes (filename.class.php) -CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of module is product -CronClassFileHelp=The file name to load.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is product.class.php -CronObjectHelp=The object name to load.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is Product -CronMethodHelp=The object method to launch.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is fecth -CronArgsHelp=The method arguments.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be 0, ProductRef +CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for module is product +CronClassFileHelp=The file name to load.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is product.class.php +CronObjectHelp=The object name to load.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for class file name is Product +CronMethodHelp=The object method to launch.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for method is fecth +CronArgsHelp=The method arguments.
    For exemple to call the fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value for paramters can be 0, ProductRef CronCommandHelp=The system command line to execute. CronCreateJob=Create new Scheduled Job CronFrom=From diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 4f700109c33..79984981e87 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -165,6 +165,7 @@ ErrorGlobalVariableUpdater5=No global variable selected ErrorFieldMustBeANumeric=Field %s must be a numeric value ErrorMandatoryParametersNotProvided=Mandatory parameter(s) not provided ErrorOppStatusRequiredIfAmount=You set an estimated amount for this opportunity/lead. So you must also enter its status +ErrorFailedToLoadModuleDescriptorForXXX=Failed to load module descriptor class for %s ErrorBadDefinitionOfMenuArrayInModuleDescriptor=Bad Definition Of Menu Array In Module Descriptor (bad value for key fk_menu) ErrorSavingChanges=An error has ocurred when saving the changes ErrorWarehouseRequiredIntoShipmentLine=Warehouse is required on the line to ship diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c567890730a..79927cc888c 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -172,7 +172,7 @@ SearchOf=Search Valid=Valid Approve=Approve Disapprove=Disapprove -ReOpen=Re-Opened +ReOpen=Re-Open Upload=Send file ToLink=Link Select=Select @@ -611,7 +611,8 @@ PartialWoman=Partial TotalWoman=Total NeverReceived=Never received Canceled=Canceled -YouCanChangeValuesForThisListFromDictionarySetup=You can change values for this list from menu setup - dictionary +YouCanChangeValuesForThisListFromDictionarySetup=You can change values for this list from menu Setup - Dictionaries +YouCanChangeValuesForThisListFrom=You can change values for this list from menu %s YouCanSetDefaultValueInModuleSetup=You can set the default value used when creating a new record into module setup Color=Color Documents=Linked files @@ -647,6 +648,7 @@ FreeLineOfType=Free entry of type CloneMainAttributes=Clone object with its main attributes PDFMerge=PDF Merge Merge=Merge +DocumentModelStandardPDF=Standard PDF template PrintContentArea=Show page to print main content area MenuManager=Menu manager WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only login %s is allowed to use application at the moment. diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 9979760bc4f..81a34b66b85 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -1,2 +1,8 @@ # Dolibarr language file - Source file is en_US - loan -ModuleBuilderDesc=This tools give you utilites to build your own module. Your modules will be generated into the first alternative directory: %s. +ModuleBuilderDesc=This tools give you utilites to build or edit your own module. +ModuleBuilderDesc2=Path were modules are generated/edited (first alternative directory defined into %s): %s. +ModuleBuilderDesc3=Modules found: %s (they are detected as editable when the file %s exists in root of module directory). +NewModule=New module +ModuleKey=Key for new module + + diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index ab937ff3bab..a37927566e3 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -61,7 +61,7 @@ PredefinedMailTestHtml=This is a test mail (the word test must be in bold PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierProposal=__CONTACTCIVNAME__\n\nYou will find here the price request __ASKREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierProposal=__CONTACTCIVNAME__\n\nYou will find here the price request __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index ac180cb5fe6..fcd28cc9f56 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -37,7 +37,6 @@ SendingSheet=Shipment sheet ConfirmDeleteSending=Are you sure you want to delete this shipment? ConfirmValidateSending=Are you sure you want to validate this shipment with reference %s? ConfirmCancelSending=Are you sure you want to cancel this shipment? -DocumentModelSimple=Simple document model DocumentModelMerou=Merou A5 model WarningNoQtyLeftToSend=Warning, no products waiting to be shipped. StatsOnShipmentsOnlyValidated=Statistics conducted on shipments only validated. Date used is date of validation of shipment (planed delivery date is not always known). diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index efcb35b802f..f5e84dd5c04 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -204,6 +204,7 @@ if ($result) print '
    '; print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',$num,$num,''); + //var_dump($conf->global->MARGIN_TYPE); if ($conf->global->MARGIN_TYPE == "1") $labelcostprice=$langs->trans('BuyingPrice'); else // value is 'costprice' or 'pmp' @@ -285,7 +286,7 @@ if ($result) } else { - print $langs->trans("NotPredefinedProducts"); + print img_object('', 'product').' '.$langs->trans("NotPredefinedProducts"); } print "
    ".$product_static->getNomUrl(1)."