Merge remote branch 'upstream/develop' into printipp

This commit is contained in:
frederic34 2014-12-28 11:59:58 +01:00
commit e937039596
146 changed files with 8368 additions and 408 deletions

View File

@ -6,6 +6,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.8 compared to 3.7.* ***** ***** ChangeLog for 3.8 compared to 3.7.* *****
For users: For users:
- New: Use new combobox. - New: Use new combobox.
- New: Add hidden option MAXTABS_IN_CARD.
For translators: For translators:
- Update language files. - Update language files.
@ -114,9 +115,11 @@ For users:
- Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action - Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action
- Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1533 ] Links triggers do not show trigger error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown - Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
- Fix: datepicker first day of week can be monday by setting into display setup - Fix: datepicker first day of week can be monday by setting into display setup
- Fix: [ bug #575 ] GED doesn't works if there is "/" in a mask
For users, new experimental module (need to set feature level of instance to experimental to see them): For users, new experimental module (need to set feature level of instance to experimental to see them):
- New: Module Accounting Expert to manage accountancy - New: Module Accounting Expert to manage accountancy
@ -163,6 +166,7 @@ For developers:
- Qual: Renamed all files & links "fiche.php" into "card.php". - Qual: Renamed all files & links "fiche.php" into "card.php".
- Qual: Replace all constants COMPTA_* by ACCOUNTING_*. - Qual: Replace all constants COMPTA_* by ACCOUNTING_*.
- Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module - Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module
- Fix: [ bug #1724 ] Can't add a submenu to projects
WARNING: Following changes may create regression for some external modules, but was necessary to make WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better: Dolibarr better:
@ -195,6 +199,10 @@ Dolibarr better:
- Fix: Show sender Country on PDF docs when sender Country <> receiver Country - Fix: Show sender Country on PDF docs when sender Country <> receiver Country
- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS - Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS
- Fix: [ bug #1749 ] Undefined $mailchimp - Fix: [ bug #1749 ] Undefined $mailchimp
- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks
- Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify
- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks
- Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs
***** ChangeLog for 3.6.1 compared to 3.6.* ***** ***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users: For users:
@ -337,6 +345,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
***** ChangeLog for 3.5.7 compared to 3.5.6 ***** ***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken dur to SSL v3 closed. Fix: Paypal link were broken dur to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
Fix: [ bug #1757 ] Sorting breaks product/service statistics
***** ChangeLog for 3.5.6 compared to 3.5.5 ***** ***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973 Fix: Avoid missing class error for fetch_thirdparty method #1973

File diff suppressed because one or more lines are too long

View File

@ -193,6 +193,7 @@ export list="
--ignore-table=$base.llx_cabinetmed_societe --ignore-table=$base.llx_cabinetmed_societe
--ignore-table=$base.llx_fournisseur_ca --ignore-table=$base.llx_fournisseur_ca
--ignore-table=$base.llx_google_maps --ignore-table=$base.llx_google_maps
--ignore-table=$base.llx_notes
--ignore-table=$base.llx_pos_paiement_ticket --ignore-table=$base.llx_pos_paiement_ticket
--ignore-table=$base.llx_pos_places --ignore-table=$base.llx_pos_places
--ignore-table=$base.llx_pos_ticket --ignore-table=$base.llx_pos_ticket
@ -200,6 +201,7 @@ export list="
--ignore-table=$base.llx_publi_c_dnd_list --ignore-table=$base.llx_publi_c_dnd_list
--ignore-table=$base.llx_publi_c_method_list --ignore-table=$base.llx_publi_c_method_list
--ignore-table=$base.llx_ultimatepdf --ignore-table=$base.llx_ultimatepdf
--ignore-table=$base.llx_ventilation_achat
" "
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile" echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile

View File

@ -141,7 +141,7 @@ $server->register(
* @param array $authentication Array of authentication information * @param array $authentication Array of authentication information
* @param int $id Id of object * @param int $id Id of object
* @param string $ref Ref of object * @param string $ref Ref of object
* @param ref_ext $ref_ext Ref external of object * @param string $ref_ext Ref external of object
* @return mixed * @return mixed
*/ */
function getSkeleton($authentication,$id,$ref='',$ref_ext='') function getSkeleton($authentication,$id,$ref='',$ref_ext='')

View File

@ -1045,7 +1045,7 @@ class Adherent extends CommonObject
* @param int $rowid Id of object to load * @param int $rowid Id of object to load
* @param string $ref To load member from its ref * @param string $ref To load member from its ref
* @param int $fk_soc To load member from its link to third party * @param int $fk_soc To load member from its link to third party
* @param int $ref_ext External reference * @param string $ref_ext External reference
* @return int >0 if OK, 0 if not found, <0 if KO * @return int >0 if OK, 0 if not found, <0 if KO
*/ */
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='') function fetch($rowid,$ref='',$fk_soc='',$ref_ext='')

View File

@ -147,7 +147,7 @@ if ($action == 'setModuleOptions')
} }
// Activate a model // Activate a model
if ($action == 'set') else if ($action == 'set')
{ {
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
} }
@ -222,7 +222,7 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
} }
} }
//Activate Set Shippable Icon In List // Activate Set Shippable Icon In List
else if ($action=="setshippableiconinlist") { else if ($action=="setshippableiconinlist") {
$setshippableiconinlist = GETPOST('value','int'); $setshippableiconinlist = GETPOST('value','int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
@ -234,6 +234,23 @@ else if ($action=="setshippableiconinlist") {
} }
} }
// Activate ask for payment bank
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
/* /*
* View * View
@ -576,6 +593,36 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
print '</a></td>'; print '</a></td>';
print '</tr>'; print '</tr>';
// Ask for payment bank during order
if ($conf->banque->enabled)
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
}
else
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ORDER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ORDER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td></tr>';
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
print '</table>'; print '</table>';
print '<br>'; print '<br>';

View File

@ -24,6 +24,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("install"); $langs->load("install");
@ -51,6 +52,13 @@ print_fiche_titre($langs->trans("PerfDolibarr"),'','setup');
print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>'; print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').' (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>';
// Recupere la version de PHP
$phpversion=version_php();
print "<br>PHP - ".$langs->trans("Version").": ".$phpversion."<br>\n";
// Recupere la version du serveur web
print "<br>Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
// XDebug // XDebug
print '<br>'; print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: '; print '<strong>'.$langs->trans("XDebug").'</strong>: ';

View File

@ -54,7 +54,7 @@ print "\n";
$var=false; $var=false;
// Recupere la version de l'OS // Recupere la version de PHP
$phpversion=version_php(); $phpversion=version_php();
print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n"; print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";

View File

@ -681,7 +681,7 @@ if ($action == 'create')
$listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true);
} }
} }
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'> '.$langs->trans("Busy"); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'> '.$langs->trans("Busy");
print '</td></tr>'; print '</td></tr>';
@ -928,7 +928,7 @@ if ($id > 0)
$listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true);
} }
} }
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0');
if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy"); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy");
print '</td></tr>'; print '</td></tr>';

View File

@ -80,15 +80,20 @@ $parameters = array('socid' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
//Some actions show a "cancel" input submit button with name="cancel"
$cancelbutton = GETPOST('cancel');
if ($action == 'setcustomeraccountancycode') if ($action == 'setcustomeraccountancycode')
{ {
$result=$object->fetch($id); if (! $cancelbutton)
$object->code_compta=$_POST["customeraccountancycode"];
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0)
{ {
setEventMessage($object->errors, 'errors'); $result=$object->fetch($id);
$object->code_compta=$_POST["customeraccountancycode"];
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0)
{
setEventMessage($object->errors, 'errors');
}
} }
$action=""; $action="";
} }
@ -140,10 +145,13 @@ if ($action == 'cstc')
// Update communication level // Update communication level
if ($action == 'setOutstandingBill') if ($action == 'setOutstandingBill')
{ {
$object->fetch($id); if (!$cancelbutton)
$object->outstanding_limit=GETPOST('OutstandingBill'); {
$result=$object->set_OutstandingBill($user); $object->fetch($id);
if ($result < 0) setEventMessage($object->error,'errors'); $object->outstanding_limit=GETPOST('OutstandingBill');
$result=$object->set_OutstandingBill($user);
if ($result < 0) setEventMessage($object->error,'errors');
}
} }
@ -289,24 +297,15 @@ if ($id > 0)
print '</tr>'; print '</tr>';
// Local Taxes // Local Taxes
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") if ($mysoc->useLocalTax(1))
{ {
print '<tr><td class="nowrap">'.$langs->trans('LocalTax1IsUsedES').'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print yn($object->localtax1_assuj);
print '</td></tr>';
print '<tr><td class="nowrap">'.$langs->trans('LocalTax2IsUsedES').'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print yn($object->localtax1_assuj); print yn($object->localtax1_assuj);
print '</td></tr>'; print '</td></tr>';
} }
elseif($mysoc->localtax2_assuj=="1") if ($mysoc->useLocalTax(2))
{ {
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
print yn($object->localtax2_assuj); print yn($object->localtax2_assuj);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -483,7 +483,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$var=true; $var=true;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1">('.$num.')</td></tr>'; print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></td></tr>';
$nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD));
while ($i < $nbofloop) while ($i < $nbofloop)

View File

@ -56,7 +56,7 @@ $search_compta=GETPOST("search_compta");
$search_status = GETPOST("search_status",'int'); $search_status = GETPOST("search_status",'int');
// Load sale and categ filters // Load sale and categ filters
$search_sale = GETPOST("search_sale"); $search_sale = GETPOST("search_sale",'int');
$search_categ = GETPOST("search_categ",'int'); $search_categ = GETPOST("search_categ",'int');
$catid = GETPOST("catid",'int'); $catid = GETPOST("catid",'int');
// If the internal user must only see his customers, force searching by him // If the internal user must only see his customers, force searching by him
@ -103,17 +103,17 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url);
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; $sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.= " s.datec, s.canvas"; $sql.= " s.datec, s.canvas";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " WHERE s.fk_stcomm = st.id";
$sql.= " AND s.client IN (1, 3)"; $sql.= " AND s.client IN (1, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
@ -130,7 +130,7 @@ if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_comp
if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status);
// Insert sale filter // Insert sale filter
if ($search_sale) if ($search_sale > 0)
{ {
$sql .= " AND sc.fk_user = ".$search_sale; $sql .= " AND sc.fk_user = ".$search_sale;
} }
@ -154,7 +154,7 @@ if ($result)
$param = "&amp;search_company=".$search_company."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town; $param = "&amp;search_company=".$search_company."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ; if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
if ($search_sale != '') $param.='&amp;search_sale='.$search_sale; if ($search_sale > 0) $param.='&amp;search_sale='.$search_sale;
if ($search_status != '') $param.='&amp;search_status='.$search_status; if ($search_status != '') $param.='&amp;search_status='.$search_status;
print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);

View File

@ -189,8 +189,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'propal'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
@ -499,9 +499,6 @@ else if ($action == 'add' && $user->rights->propal->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'propal'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
@ -1314,7 +1311,7 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->module->banque->enabled) { if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->banque->enabled) {
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1); $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '</td></tr>'; print '</td></tr>';
@ -2110,12 +2107,14 @@ if ($action == 'create')
// Create an invoice and classify billed // Create an invoice and classify billed
if ($object->statut == 2) { if ($object->statut == 2) {
if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddBill") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/compta/facture.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddBill") . '</a></div>';
} }
$arraypropal = $object->getInvoiceArrayList(); $arrayofinvoiceforpropal = $object->getInvoiceArrayList();
if (is_array($arraypropal) && count($arraypropal) > 0) { if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES))
{
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=classifybilled&amp;socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
} }
} }

View File

@ -47,6 +47,11 @@ class Propal extends CommonObject
public $fk_element='fk_propal'; public $fk_element='fk_propal';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $socid; // Id client var $socid; // Id client
@ -1987,16 +1992,19 @@ class Propal extends CommonObject
{ {
$linkedInvoices[] = $objectid[$i]; $linkedInvoices[] = $objectid[$i];
} }
// Cas des factures liees via la commande // Cas des factures liees par un autre objet (ex: commande)
else else
{ {
$this->fetchObjectLinked($objectid[$i],$objecttype); $this->fetchObjectLinked($objectid[$i],$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{ {
$numj=count($subobjectid); $numj=count($subobjectid);
for ($j=0;$j<$numj;$j++) for ($j=0;$j<$numj;$j++)
{ {
$linkedInvoices[] = $subobjectid[$j]; if ($subobjecttype == 'facture')
{
$linkedInvoices[] = $subobjectid[$j];
}
} }
} }
} }

View File

@ -152,7 +152,7 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p';
if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal'; if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
// We'll need this table joined to the select in order to filter by sale // We'll need this table joined to the select in order to filter by sale
if ($search_sale || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.=", ".MAIN_DB_PREFIX."element_contact as c"; $sql.=", ".MAIN_DB_PREFIX."element_contact as c";

View File

@ -141,8 +141,8 @@ if ($resql)
else dol_print_error($db); else dol_print_error($db);
// Load sale and categ filters // Load sale and categ filters
$search_sale = GETPOST('search_sale'); $search_sale = GETPOST('search_sale','int');
$search_categ = GETPOST('search_categ'); $search_categ = GETPOST('search_categ','int');
// If the internal user must only see his prospect, force searching by him // If the internal user must only see his prospect, force searching by him
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
@ -200,11 +200,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)";
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " WHERE s.fk_stcomm = st.id";
$sql.= " AND s.client IN (2, 3)"; $sql.= " AND s.client IN (2, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = " .$socid; if ($socid) $sql.= " AND s.rowid = " .$socid;
if (isset($stcomm) && $stcomm != '') $sql.= " AND s.fk_stcomm=".$stcomm; if (isset($stcomm) && $stcomm != '') $sql.= " AND s.fk_stcomm=".$stcomm;
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
@ -229,7 +229,7 @@ if ($search_levels)
$sql .= " AND s.fk_prospectlevel IN (".$search_levels.')'; $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
} }
// Insert sale filter // Insert sale filter
if ($search_sale) if ($search_sale > 0)
{ {
$sql .= " AND sc.fk_user = ".$db->escape($search_sale); $sql .= " AND sc.fk_user = ".$db->escape($search_sale);
} }
@ -281,7 +281,7 @@ if ($resql)
if ($search_level_from != '') $param.='&amp;search_level_from='.$search_level_from; if ($search_level_from != '') $param.='&amp;search_level_from='.$search_level_from;
if ($search_level_to != '') $param.='&amp;search_level_to='.$search_level_to; if ($search_level_to != '') $param.='&amp;search_level_to='.$search_level_to;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ; if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
if ($search_sale != '') $param.='&amp;search_sale='.$search_sale; if ($search_sale > 0) $param.='&amp;search_sale='.$search_sale;
if ($search_status != '') $param.='&amp;search_status='.$search_status; if ($search_status != '') $param.='&amp;search_status='.$search_status;
// $param and $urladd should have the same value // $param and $urladd should have the same value
$urladd = $param; $urladd = $param;

View File

@ -922,8 +922,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'order'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
@ -971,8 +971,8 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'order'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }

View File

@ -44,6 +44,11 @@ class Commande extends CommonOrder
public $fk_element = 'fk_commande'; public $fk_element = 'fk_commande';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $socid; // Id client var $socid; // Id client

View File

@ -30,9 +30,7 @@
/** /**
* \class BankCateg * Class to manage bank categories
* \brief Class to manage bank categories
* \remarks Initialy built by build_class_from_table on 2009-01-02 15:26
*/ */
class BankCateg // extends CommonObject class BankCateg // extends CommonObject
{ {
@ -300,7 +298,7 @@ class BankCateg // extends CommonObject
$error=0; $error=0;
$object=new Bank_categ($this->db); $object=new BankCateg($this->db);
$this->db->begin(); $this->db->begin();

View File

@ -102,7 +102,7 @@ if ($conf->salaries->enabled)
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
$sql.= " AND s.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; $sql.= " AND s.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
} }
if (preg_match('/^s/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
@ -204,7 +204,7 @@ if ($conf->tax->enabled)
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= ")"; $sql .= ")";
} }
if (! preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); if (preg_match('/^cs\./',$sortfield) || preg_match('/^c\./',$sortfield) || preg_match('/^pc\./',$sortfield) || preg_match('/^pct\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
//$sql.= $db->plimit($limit+1,$offset); //$sql.= $db->plimit($limit+1,$offset);
//print $sql; //print $sql;
@ -295,7 +295,7 @@ if ($conf->tax->enabled)
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
$sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
} }
if (preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); if (preg_match('/^pv\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)

View File

@ -417,8 +417,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }
@ -500,8 +500,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
} }
@ -1328,8 +1328,8 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }

View File

@ -50,6 +50,11 @@ class Facture extends CommonInvoice
public $fk_element = 'fk_facture'; public $fk_element = 'fk_facture';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'facnumber';
var $id; var $id;
//! Id client //! Id client
var $socid; var $socid;
@ -833,7 +838,6 @@ class Facture extends CommonInvoice
return $result; return $result;
} }
/** /**
* Get object and lines from database * Get object and lines from database
* *
@ -2479,7 +2483,7 @@ class Facture extends CommonInvoice
* Return next reference of customer invoice not already used (or last reference) * Return next reference of customer invoice not already used (or last reference)
* according to numbering module defined into constant FACTURE_ADDON * according to numbering module defined into constant FACTURE_ADDON
* *
* @param Society $soc object company * @param Societe $soc object company
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string free ref or last ref * @return string free ref or last ref
*/ */

View File

@ -167,7 +167,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' ('.$num.')':'').'</td></tr>'; print '<td colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
if ($num) if ($num)
{ {
$companystatic=new Societe($db); $companystatic=new Societe($db);
@ -236,7 +236,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' ('.$num.')':'').'</td></tr>'; print '<td colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
if ($num) if ($num)
{ {
$companystatic=new Societe($db); $companystatic=new Societe($db);
@ -555,7 +555,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("ContributionsToPay").($num?' ('.$num.')':'').'</td>'; print '<td>'.$langs->trans("ContributionsToPay").($num?' <span class="badge">'.$num.'</span>':'').'</td>';
print '<td align="center">'.$langs->trans("DateDue").'</td>'; print '<td align="center">'.$langs->trans("DateDue").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>'; print '<td align="right">'.$langs->trans("Paid").'</td>';
@ -639,7 +639,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$i = 0; $i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?status=3&afacturer=1">('.$num.')</a></td>'; print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/list.php?status=3&amp;afacturer=1"><span class="badge">'.$num.'</span></a></td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("ToBill").'</td>'; print '<td align="right">'.$langs->trans("ToBill").'</td>';
@ -737,7 +737,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$i = 0; $i = 0;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php"><span class="badge">'.$num.'</span></a></td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Received").'</td>'; print '<td align="right">'.$langs->trans("Received").'</td>';
@ -842,7 +842,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php"><span class="badge">'.$num.'</span></a></td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>'; print '<td align="right">'.$langs->trans("Paid").'</td>';
@ -916,7 +916,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>"; print "<tr ".$bc[$var]."><td>".dol_print_date($obj->da,"day")."</td>";
print "<td><a href=\"action/card.php\">$obj->libelle $obj->label</a></td></tr>"; print '<td><a href="action/card.php">'.$obj->libelle.' '.$obj->label.'</a></td></tr>';
$i++; $i++;
} }
$db->free($resql); $db->free($resql);

View File

@ -1634,7 +1634,7 @@ class BonPrelevement extends CommonObject
* @param int $nombre 0 or 1 * @param int $nombre 0 or 1
* @param float $total Total * @param float $total Total
* @param string $CrLf End of line character * @param string $CrLf End of line character
* @return SEPA * @return string String with SEAP Sender
*/ */
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n')
{ // SEPA INITIALISATION { // SEPA INITIALISATION

View File

@ -34,6 +34,11 @@ class ChargeSociales extends CommonObject
public $table='chargesociales'; public $table='chargesociales';
public $table_element='chargesociales'; public $table_element='chargesociales';
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $ref; var $ref;
var $date_ech; var $date_ech;

View File

@ -209,6 +209,8 @@ $maxyear=substr($maxyearmonth,0,4);
$nowyear=strftime("%Y",dol_now()); $nowyear=strftime("%Y",dol_now());
$nowyearmonth=strftime("%Y-%m",dol_now()); $nowyearmonth=strftime("%Y-%m",dol_now());
$maxyearmonth=max($maxyearmonth,$nowyearmonth); $maxyearmonth=max($maxyearmonth,$nowyearmonth);
$now=dol_now();
$casenow = dol_print_date($now,"%Y-%m");
// Loop on each month // Loop on each month
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0; $nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0;
@ -220,22 +222,37 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>"; print "<td>".dol_print_date(dol_mktime(12,0,0,$mois_modulo,1,2000),"%B")."</td>";
for ($annee = $year_start ; $annee <= $year_end ; $annee++) for ($annee = $year_start -1 ; $annee <= $year_end ; $annee++) // We start one year before to have data to be able to make delta
{ {
$now=dol_now();
$annee_decalage=$annee; $annee_decalage=$annee;
if ($mois>12) {$annee_decalage=$annee+1;} if ($mois>12) {$annee_decalage=$annee+1;}
$casenow = dol_print_date($now,"%Y-%m");
$case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m"); $case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m");
$caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m"); $caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m");
if ($modecompta == 'CREANCES-DETTES') { if ($annee >= $year_start)
// Valeur CA du mois w/o VAT {
if ($modecompta == 'CREANCES-DETTES') {
// Valeur CA du mois w/o VAT
print '<td align="right">';
if ($cum_ht[$case])
{
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum_ht[$case],1).'</a>';
}
else
{
if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; }
else { print '&nbsp;'; }
}
print "</td>";
}
// Valeur CA du mois
print '<td align="right">'; print '<td align="right">';
if ($cum_ht[$case]) if ($cum[$case])
{ {
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre. $now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum_ht[$case],1).'</a>'; print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum[$case],1).'</a>';
} }
else else
{ {
@ -243,60 +260,46 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
else { print '&nbsp;'; } else { print '&nbsp;'; }
} }
print "</td>"; print "</td>";
}
// Valeur CA du mois // Pourcentage du mois
print '<td align="right">'; if ($annee_decalage > $minyear && $case <= $casenow)
if ($cum[$case])
{
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum[$case],1).'</a>';
}
else
{
if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; }
else { print '&nbsp;'; }
}
print "</td>";
// Pourcentage du mois
if ($annee_decalage > $minyear && $case <= $casenow)
{
if ($cum[$caseprev] && $cum[$case])
{ {
$percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100); if ($cum[$caseprev] && $cum[$case])
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X"; {
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>'; $percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100);
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
}
if ($cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-100%</td>';
}
if (! $cum[$caseprev] && $cum[$case])
{
//print '<td align="right">+Inf%</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">+0%</td>';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-</td>';
}
} }
if ($cum[$caseprev] && ! $cum[$case]) else
{ {
print '<td align="right" class="borderrightlight">-100%</td>'; print '<td align="right" class="borderrightlight">';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print '&nbsp;'; }
print '</td>';
} }
if (! $cum[$caseprev] && $cum[$case]) if ($annee_decalage != $year_end) print '<td width="15">&nbsp;</td>';
{
//print '<td align="right">+Inf%</td>';
print '<td align="right" class="borderrightlight">-</td>';
}
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">+0%</td>';
}
if (! isset($cum[$caseprev]) && ! $cum[$case])
{
print '<td align="right" class="borderrightlight">-</td>';
}
}
else
{
print '<td align="right" class="borderrightlight">';
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
else { print '&nbsp;'; }
print '</td>';
} }
$total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;; $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;;
$total[$annee]+=$cum[$case]; $total[$annee]+=$cum[$case];
if ($annee_decalage != $year_end) print '<td width="15">&nbsp;</td>';
} }
print '</tr>'; print '</tr>';
@ -406,7 +409,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
} }
if (! $total[$annee-1] && $total[$annee]) if (! $total[$annee-1] && $total[$annee])
{ {
print '<td align="right" class="borderrightlight">+Inf%</td>'; print '<td align="right" class="borderrightlight">+zzzz'.$total[$annee-1].$langs->trans('Inf').'%</td>';
} }
if (! $total[$annee-1] && ! $total[$annee]) if (! $total[$annee-1] && ! $total[$annee])
{ {

View File

@ -343,7 +343,7 @@ class Tva extends CommonObject
} }
/** /**
* Total of the VAT from invoices emitted by the society. * Total of the VAT from invoices emitted by the thirdparty.
* *
* @param int $year Year * @param int $year Year
* @return double Amount * @return double Amount

View File

@ -44,6 +44,11 @@ class Contrat extends CommonObject
public $fk_element='fk_contrat'; public $fk_element='fk_contrat';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $ref; var $ref;
var $ref_ext; var $ref_ext;
@ -54,11 +59,11 @@ class Contrat extends CommonObject
var $product; var $product;
var $user_author; var $user_author;
var $date_creation; var $date_creation; // date of creation
var $date_validation; var $date_validation; // date of last update
var $date_contrat; var $date_contrat; // date when contract was signed
var $date_cloture; var $date_cloture; // deprecated (we close contract lines, not a contract)
var $commercial_signature_id; var $commercial_signature_id;
var $commercial_suivi_id; var $commercial_suivi_id;
@ -88,7 +93,7 @@ class Contrat extends CommonObject
/** /**
* Return next contract ref * Return next contract ref
* *
* @param Societe $soc objet society * @param Societe $soc Thirdparty object
* @return string free reference for contract * @return string free reference for contract
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)

View File

@ -245,7 +245,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("DraftContracts").($num?' ('.$num.')':'').'</td></tr>'; print '<td colspan="3">'.$langs->trans("DraftContracts").($num?' <span class="badge">'.$num.'</span>':'').'</td></tr>';
if ($num) if ($num)
{ {
$companystatic=new Societe($db); $companystatic=new Societe($db);
@ -471,7 +471,7 @@ if ($resql)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("NotActivatedServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=0">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("NotActivatedServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=0"><span class="badge">'.$num.'</span></a></td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
@ -551,7 +551,7 @@ if ($resql)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=4&filter=expired">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ListOfExpiredServices").' <a href="'.DOL_URL_ROOT.'/contrat/services.php?mode=4&amp;filter=expired"><span class="badge">'.$num.'</span></a></td>';
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr> /* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
@ -45,7 +46,7 @@ class box_project extends ModeleBoxes
$langs->load("boxes"); $langs->load("boxes");
$langs->load("projects"); $langs->load("projects");
$this->boxlabel="Projet"; $this->boxlabel="Projects";
} }
/** /**
@ -63,13 +64,8 @@ class box_project extends ModeleBoxes
$totalMnt = 0; $totalMnt = 0;
$totalnb = 0; $totalnb = 0;
$totalnbTask=0; $totalnbTask=0;
include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
$projectstatic=new Project($db);
$textHead = $langs->trans("Projects");
$textHead = $langs->trans("Projet");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders // list the summary of the orders
@ -91,14 +87,15 @@ class box_project extends ModeleBoxes
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projectpub');
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$projectstatic->fetch($objp->rowid);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => 'object_project',
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$projectstatic->getNomUrl(1) 'text' => $objp->ref,
); 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"', $this->info_box_contents[$i][2] = array('td' => 'align="left"',
'text' => $objp->title 'text' => $objp->title

View File

@ -6,7 +6,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -35,8 +35,18 @@
abstract class CommonObject abstract class CommonObject
{ {
public $db; public $db;
/**
* @var error Error string
* @deprecated Use instead the array of error strings
*/
public $error; public $error;
/**
* @var errors Aray of error string
*/
public $errors; public $errors;
public $canvas; // Contains canvas name if it is public $canvas; // Contains canvas name if it is
public $name; public $name;
@ -54,6 +64,12 @@ abstract class CommonObject
// No constructor as it is an abstract class // No constructor as it is an abstract class
/**
* Column name of the ref field.
* @var string
*/
protected $table_ref_field = '';
/** /**
* Check an object id/ref exists * Check an object id/ref exists
@ -631,6 +647,32 @@ abstract class CommonObject
} }
/**
* Looks for an object with ref matching the wildcard provided
* It does only work when $this->table_ref_field is set
*
* @param string $ref Wildcard
* @return int >1 = OK, 0 = Not found or table_ref_field not defined, <0 = KO
*/
public function fetchOneLike($ref)
{
if (!$this->table_ref_field) {
return 0;
}
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE '.$this->table_ref_field.' LIKE "'.$this->db->escape($ref).'" LIMIT 1';
$query = $this->db->query($sql);
if (!$this->db->num_rows($query)) {
return 0;
}
$result = $this->db->fetch_object($query);
return $this->fetch($result->rowid);
}
/** /**
* Load data for barcode into properties ->barcode_type* * Load data for barcode into properties ->barcode_type*
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but * Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
@ -1851,7 +1893,7 @@ abstract class CommonObject
} }
} }
else else
{ {
$sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')";
$sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')";
} }

View File

@ -12,7 +12,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
@ -400,14 +400,26 @@ class Form
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
$s=""; $s="";
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>'; if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>'; if ($direction < 0) {
$s.='<'.$tag.$paramfortooltipimg;
if ($tag == 'td') {
$s .= 'valign="top" ';
}
$s.= 'width="14">'.$img.'</'.$tag.'>';
}
// Use another method to help avoid having a space in value in order to use this value with jquery // Use another method to help avoid having a space in value in order to use this value with jquery
// TODO add this in css // TODO add this in css
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>'; //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>'; if ($direction > 0) {
$s.='<'.$tag.$paramfortooltipimg;
if ($tag == 'td') {
$s .= 'valign="top" ';
}
$s.= 'width="14">'.$img.'</'.$tag.'>';
}
if (empty($notabs)) $s.='</tr></table>'; if (empty($notabs)) $s.='</tr></table>';
return $s; return $s;
@ -1185,7 +1197,7 @@ class Form
else $sql.= " WHERE u.entity IS NOT NULL"; else $sql.= " WHERE u.entity IS NOT NULL";
} }
else else
{ {
if (! empty($conf->multicompany->transverse_mode)) if (! empty($conf->multicompany->transverse_mode))
{ {
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
@ -1201,7 +1213,7 @@ class Form
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')"; if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')"; if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut <> 0"; if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut <> 0";
if (! empty($morefilter)) $sql.=$morefilter; if (! empty($morefilter)) $sql.=" ".$morefilter;
$sql.= " ORDER BY u.lastname ASC"; $sql.= " ORDER BY u.lastname ASC";
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
@ -1279,7 +1291,7 @@ class Form
} }
else else
{ {
$out.=($moreinfo?' - ':' (').$obj->label; $out.=($moreinfo?' - ':' (').($obj->label?$obj->label:$langs->trans("EntityNameNotDefined"));
$moreinfo++; $moreinfo++;
} }
} }
@ -3773,7 +3785,7 @@ class Form
* @param string $prefix Prefix for fields name * @param string $prefix Prefix for fields name
* @param int $h 1=Show also hours * @param int $h 1=Show also hours
* @param int $m 1=Show also minutes * @param int $m 1=Show also minutes
* @param int $empty 0=Fields required, 1=Empty input is allowed * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
* @param string $form_name Not used * @param string $form_name Not used
* @param int $d 1=Show days, month, years * @param int $d 1=Show days, month, years
* @param int $addnowbutton Add a button "Now" * @param int $addnowbutton Add a button "Now"
@ -3792,9 +3804,13 @@ class Form
if($prefix=='') $prefix='re'; if($prefix=='') $prefix='re';
if($h == '') $h=0; if($h == '') $h=0;
if($m == '') $m=0; if($m == '') $m=0;
if($empty == '') $empty=0; $emptydate=0;
$emptyhours=0;
if ($empty == 1) { $emptydate=1; $emptyhours=1; }
if ($empty == 2) { $emptydate=0; $emptyhours=1; }
$orig_set_time=$set_time;
if ($set_time === '' && $empty == 0) if ($set_time === '' && $emptydate == 0)
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone $set_time = dol_now('tzuser')-(getServerTimeZoneInt('now')*3600); // set_time must be relative to PHP server timezone
@ -3816,8 +3832,11 @@ class Form
$syear = dol_print_date($set_time, "%Y"); $syear = dol_print_date($set_time, "%Y");
$smonth = dol_print_date($set_time, "%m"); $smonth = dol_print_date($set_time, "%m");
$sday = dol_print_date($set_time, "%d"); $sday = dol_print_date($set_time, "%d");
$shour = dol_print_date($set_time, "%H"); if ($orig_set_time != '')
$smin = dol_print_date($set_time, "%M"); {
$shour = dol_print_date($set_time, "%H");
$smin = dol_print_date($set_time, "%M");
}
} }
else else
{ {
@ -3879,7 +3898,7 @@ class Form
// Day // Day
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'day">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'day">';
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<option value="0" selected="selected">&nbsp;</option>'; $retstring.='<option value="0" selected="selected">&nbsp;</option>';
} }
@ -3892,7 +3911,7 @@ class Form
$retstring.="</select>"; $retstring.="</select>";
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'month">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat" name="'.$prefix.'month">';
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<option value="0" selected="selected">&nbsp;</option>'; $retstring.='<option value="0" selected="selected">&nbsp;</option>';
} }
@ -3907,7 +3926,7 @@ class Form
$retstring.="</select>"; $retstring.="</select>";
// Year // Year
if ($empty || $set_time == -1) if ($emptydate || $set_time == -1)
{ {
$retstring.='<input'.($disabled?' disabled="disabled"':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">'; $retstring.='<input'.($disabled?' disabled="disabled"':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">';
} }
@ -3930,7 +3949,7 @@ class Form
{ {
// Show hour // Show hour
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'hour':'').'" name="'.$prefix.'hour">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($hour = 0; $hour < 24; $hour++) for ($hour = 0; $hour < 24; $hour++)
{ {
if (strlen($hour) < 2) $hour = "0" . $hour; if (strlen($hour) < 2) $hour = "0" . $hour;
@ -3944,7 +3963,7 @@ class Form
{ {
// Show minutes // Show minutes
$retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">'; $retstring.='<select'.($disabled?' disabled="disabled"':'').' class="flat '.($fullday?$fullday.'min':'').'" name="'.$prefix.'min">';
if ($empty) $retstring.='<option value="-1">&nbsp;</option>'; if ($emptyhours) $retstring.='<option value="-1">&nbsp;</option>';
for ($min = 0; $min < 60 ; $min++) for ($min = 0; $min < 60 ; $min++)
{ {
if (strlen($min) < 2) $min = "0" . $min; if (strlen($min) < 2) $min = "0" . $min;
@ -4003,18 +4022,22 @@ class Form
/** /**
* Function to show a form to select a duration on a page * Function to show a form to select a duration on a page
* *
* @param string $prefix Prefix * @param string $prefix Prefix for input fields
* @param int $iSecond Default preselected duration (number of seconds) * @param int $iSecond Default preselected duration (number of seconds)
* @param int $disabled Disable the combo box * @param int $disabled Disable the combo box
* @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo
* @param string $minunderhours If 1, show minutes selection under the hours * @param string $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it
* @return void * @return void
*/ */
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0) function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
{ {
global $langs; global $langs;
$retstring='';
$hourSelected=0; $minSelected=0; $hourSelected=0; $minSelected=0;
if ($iSecond) if ($iSecond)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -4025,36 +4048,51 @@ class Form
if ($typehour=='select') if ($typehour=='select')
{ {
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>'; $retstring.='<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours
{ {
print '<option value="'.$hour.'"'; $retstring.='<option value="'.$hour.'"';
if ($hourSelected == $hour) if ($hourSelected == $hour)
{ {
print " selected=\"true\""; $retstring.=" selected=\"true\"";
} }
print ">".$hour."</option>"; $retstring.=">".$hour."</option>";
} }
print "</select>"; $retstring.="</select>";
} }
elseif ($typehour=='text') elseif ($typehour=='text')
{ {
print '<input type="text" size="3" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.((int) $hourSelected).'">'; $retstring.='<input type="text" size="2" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.($hourSelected?((int) $hourSelected):'').'">';
} }
print ' '.$langs->trans('HourShort'); else return 'BadValueForParameterTypeHour';
if ($minunderhours) print '<br>'; $retstring.=' '.$langs->trans('HourShort');
else print "&nbsp;";
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>'; if ($minunderhours) $retstring.='<br>';
for ($min = 0; $min <= 55; $min=$min+5) else $retstring.="&nbsp;";
if ($typehour=='select')
{ {
print '<option value="'.$min.'"'; $retstring.='<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';
if ($minSelected == $min) print ' selected="selected"'; for ($min = 0; $min <= 55; $min=$min+5)
print '>'.$min.'</option>'; {
$retstring.='<option value="'.$min.'"';
if ($minSelected == $min) $retstring.=' selected="selected"';
$retstring.='>'.$min.'</option>';
}
$retstring.="</select>";
} }
print "</select>"; elseif ($typehour=='text')
print ' '.$langs->trans('MinuteShort'). "&nbsp;"; {
$retstring.='<input type="text" size="2" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.($minSelected?((int) $minSelected):'').'">';
}
$retstring.=' '.$langs->trans('MinuteShort');
$retstring.="&nbsp;";
if (! empty($nooutput)) return $retstring;
print $retstring;
return;
} }

View File

@ -998,7 +998,6 @@ class FormFile
if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
if (! $id && ! $ref) continue; if (! $id && ! $ref) continue;
$found=0; $found=0;
if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref]))
{ {
@ -1007,7 +1006,19 @@ class FormFile
else else
{ {
//print 'Fetch '.$id." - ".$ref.'<br>'; //print 'Fetch '.$id." - ".$ref.'<br>';
$result=$object_instance->fetch($id,$ref);
if ($id) {
$result = $object_instance->fetch($id);
} else {
//fetchOneLike looks for objects with wildcards in its reference.
//It is useful for those masks who get underscores instead of their actual symbols
//fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned
//that's why we look only look fetchOneLike when fetch returns 0
if (!$result = $object_instance->fetch('', $ref)) {
$result = $object_instance->fetchOneLike($ref);
}
}
if ($result > 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]=dol_clone($object_instance); } // Save object into a cache if ($result > 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]=dol_clone($object_instance); } // Save object into a cache
if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); } if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); }
} }

View File

@ -349,16 +349,26 @@ class FormOther
* @param string $htmlname Name of combo list (example: 'search_sale') * @param string $htmlname Name of combo list (example: 'search_sale')
* @param User $user Object user * @param User $user Object user
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param int $showempty 1=show also an empty value
* @return string Html combo list code * @return string Html combo list code
*/ */
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0) function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1)
{ {
global $conf,$langs; global $conf,$langs;
$langs->load('users'); $langs->load('users');
$out = '';
$nodatarole = '';
// Enhance with select2
if ($conf->use_javascript_ajax)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($htmlname);
$nodatarole=' data-role="none"';
}
// Select each sales and print them in a select input // Select each sales and print them in a select input
$moreforfilter ='<select class="flat" name="'.$htmlname.'">'; $out.='<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$nodatarole.'>';
$moreforfilter.='<option value="">&nbsp;</option>'; if ($showempty) $out.='<option value="-1">&nbsp;</option>';
// Get list of users allowed to be viewed // Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login"; $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
@ -383,34 +393,35 @@ class FormOther
{ {
while ($obj_usr = $this->db->fetch_object($resql_usr)) while ($obj_usr = $this->db->fetch_object($resql_usr))
{ {
$moreforfilter.='<option value="'.$obj_usr->rowid.'"';
if ($obj_usr->rowid == $selected) $moreforfilter.=' selected="selected"'; $out.='<option value="'.$obj_usr->rowid.'"';
$moreforfilter.='>'; if ($obj_usr->rowid == $selected) $out.=' selected="selected"';
$moreforfilter.=dolGetFirstLastname($obj_usr->firstname,$obj_usr->lastname);
$out.='>';
$out.=dolGetFirstLastname($obj_usr->firstname,$obj_usr->lastname);
// Complete name with more info // Complete name with more info
$moreinfo=0; $moreinfo=0;
if (! empty($conf->global->MAIN_SHOW_LOGIN)) if (! empty($conf->global->MAIN_SHOW_LOGIN))
{ {
$moreforfilter.=($moreinfo?' - ':' (').$obj_usr->login; $out.=($moreinfo?' - ':' (').$obj_usr->login;
$moreinfo++; $moreinfo++;
} }
if ($showstatus >= 0) if ($showstatus >= 0)
{ {
if ($obj_usr->statut == 1 && $showstatus == 1) if ($obj_usr->statut == 1 && $showstatus == 1)
{ {
$moreforfilter.=($moreinfo?' - ':' (').$langs->trans('Enabled'); $out.=($moreinfo?' - ':' (').$langs->trans('Enabled');
$moreinfo++; $moreinfo++;
} }
if ($obj_usr->statut == 0) if ($obj_usr->statut == 0)
{ {
$moreforfilter.=($moreinfo?' - ':' (').$langs->trans('Disabled'); $out.=($moreinfo?' - ':' (').$langs->trans('Disabled');
$moreinfo++; $moreinfo++;
} }
} }
$moreforfilter.=($moreinfo?')':''); $out.=($moreinfo?')':'');
$moreforfilter.='</option>'; $out.='</option>';
} }
$this->db->free($resql_usr); $this->db->free($resql_usr);
} }
@ -418,9 +429,9 @@ class FormOther
{ {
dol_print_error($this->db); dol_print_error($this->db);
} }
$moreforfilter.='</select>'; $out.='</select>';
return $moreforfilter; return $out;
} }
/** /**

View File

@ -197,6 +197,7 @@ class Link extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} else { } else {
setEventMessages('', $this->errors, 'errors');
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }

View File

@ -388,7 +388,7 @@ class DoliDBPgsql extends DoliDB
if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT'))
{ {
$con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty
$this->db = pg_connect($con_string); $this->db = @pg_connect($con_string);
} }
// if local connection failed or not requested, use TCP/IP // if local connection failed or not requested, use TCP/IP
@ -398,7 +398,7 @@ class DoliDBPgsql extends DoliDB
if (! $port) $port = 5432; if (! $port) $port = 5432;
$con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'"; $con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'";
$this->db = pg_connect($con_string); $this->db = @pg_connect($con_string);
} }
// now we test if at least one connect method was a success // now we test if at least one connect method was a success
@ -668,7 +668,7 @@ class DoliDBPgsql extends DoliDB
/** /**
* Renvoie le code erreur generique de l'operation precedente. * Renvoie le code erreur generique de l'operation precedente.
* *
* @return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/ */
function errno() function errno()
{ {
@ -734,7 +734,7 @@ class DoliDBPgsql extends DoliDB
/** /**
* Renvoie le texte de l'erreur pgsql de l'operation precedente * Renvoie le texte de l'erreur pgsql de l'operation precedente
* *
* @return error_text * @return string Error text
*/ */
function error() function error()
{ {
@ -837,7 +837,7 @@ class DoliDBPgsql extends DoliDB
// Test charset match LC_TYPE (pgsql error otherwise) // Test charset match LC_TYPE (pgsql error otherwise)
//print $charset.' '.setlocale(LC_CTYPE,'0'); exit; //print $charset.' '.setlocale(LC_CTYPE,'0'); exit;
$sql='CREATE DATABASE '.$database.' OWNER '.$owner.' ENCODING \''.$charset.'\''; $sql='CREATE DATABASE "'.$database.'" OWNER "'.$owner.'" ENCODING \''.$charset.'\'';
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
$ret=$this->query($sql); $ret=$this->query($sql);
return $ret; return $ret;

View File

@ -535,7 +535,7 @@ class DoliDBSqlite extends DoliDB
/** /**
* Renvoie le code erreur generique de l'operation precedente. * Renvoie le code erreur generique de l'operation precedente.
* *
* @return string $error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
*/ */
function errno() function errno()
{ {
@ -597,7 +597,7 @@ class DoliDBSqlite extends DoliDB
/** /**
* Renvoie le texte de l'erreur mysql de l'operation precedente. * Renvoie le texte de l'erreur mysql de l'operation precedente.
* *
* @return string $error_text * @return string Error text
*/ */
function error() function error()
{ {

View File

@ -149,7 +149,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (! empty($conf->browser->phone)) print '</div>'; if (! empty($conf->browser->phone)) print '</div>';
else print '</td>'; else print '</td>';
if (! empty($conf->browser->phone)) print '<div class="fichehalfright" valign="middle">'; if (! empty($conf->browser->phone)) print '<div class="fichehalfright">';
else print '<td align="center" valign="middle" class="nowrap">'; else print '<td align="center" valign="middle" class="nowrap">';
print '<table><tr><td align="center">'; print '<table><tr><td align="center">';

View File

@ -32,6 +32,8 @@
function ecm_prepare_dasboard_head($object) function ecm_prepare_dasboard_head($object)
{ {
global $langs, $conf, $user, $form; global $langs, $conf, $user, $form;
global $helptext1, $helptext2;
$h = 0; $h = 0;
$head = array(); $head = array();
$helptext =$langs->trans("ECMAreaDesc").'<br>'; $helptext =$langs->trans("ECMAreaDesc").'<br>';

View File

@ -684,38 +684,82 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
} }
// Show tabs // Show tabs
$bactive=false;
// if =0 we don't use the feature
$limittoshow=($conf->global->MAXTABS_IN_CARD?$conf->global->MAXTABS_IN_CARD:99);
$displaytab=0;
for ($i = 0 ; $i <= $maxkey ; $i++) for ($i = 0 ; $i <= $maxkey ; $i++)
{ {
$isactive=(is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]);
$out.='<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((! $isactive && ! empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT))?' hideonprint':'').'">'; if ((is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]))
if (isset($links[$i][2]) && $links[$i][2] == 'image')
{ {
if (!empty($links[$i][0])) $isactive=true;
{ $bactive=true;
$out.='<a data-role="button" class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; if ($i <=$limittoshow)
} $limittoshow++;
else
{
$out.='<span data-role="button" class="tabspan">'.$links[$i][1].'</span>'."\n";
}
} }
else if (! empty($links[$i][1])) else
$isactive=false;
if ($i <=$limittoshow || $isactive )
{ {
//print "x $i $active ".$links[$i][2]." z"; $out.='<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((! $isactive && ! empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT))?' hideonprint':'').'">';
if ($isactive) if (isset($links[$i][2]) && $links[$i][2] == 'image')
{ {
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabactive tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; if (!empty($links[$i][0]))
{
$out.='<a data-role="button" class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
}
else
{
$out.='<span data-role="button" class="tabspan">'.$links[$i][1].'</span>'."\n";
}
} }
else else if (! empty($links[$i][1]))
{ {
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n"; //print "x $i $active ".$links[$i][2]." z";
if ($isactive)
{
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tabactive tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
}
else
{
$out.='<a data-role="button"'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="tab inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
}
} }
$out.='</div>';
} }
$out.='</div>'; else
{
$outmore.='<div class="" style="display:inherit; background-color:#f9f9f9; padding-top:5px; padding-right:15px; padding-left:12px;">';
if (isset($links[$i][2]) && $links[$i][2] == 'image')
{
if (!empty($links[$i][0]))
$outmore.='<a class="tabimage" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
else
$outmore.='<span class="tabspan">'.$links[$i][1].'</span>'."\n";
}
else if (! empty($links[$i][1]))
$outmore.='<a "'.(! empty($links[$i][2])?' id="'.$links[$i][2].'"':'').' class="inline-block" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
$outmore.='</div>';
}
$displaytab=$i;
} }
$out.="</div>\n"; if ($displaytab > $limittoshow)
{
$out.='<div id=moretabs class="inline-block tabsElem"><a href="" data-role="button" style="background-color: #f0f0f0;" class="tab inline-block">Plus</a>';
$out.='<div id=moretabsList style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div></div>';
$out.="</div>\n";
$out.="<script>";
$out.="$('#moretabs').mouseenter( function() { $('#moretabsList').css('left','auto');});";
$out.="$('#moretabs').mouseleave( function() { $('#moretabsList').css('left','-999em');});";
$out.="</script>";
}
if (! $notab) $out.="\n".'<div class="tabBar">'."\n"; if (! $notab) $out.="\n".'<div class="tabBar">'."\n";
@ -2609,10 +2653,11 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
} }
/** /**
* Show a title (deprecated. use print_fiche_titre instead) * Show a title.
* *
* @param string $title Title to show * @param string $title Title to show
* @return string Title to show * @return string Title to show
* @deprecated Use print_fiche_titre instead
*/ */
function print_titre($title) function print_titre($title)
{ {

View File

@ -573,7 +573,7 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/** /**
* Return last or next value for a mask (according to area we should not reset) * Return last or next value for a mask (according to area we should not reset)
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $mask Mask to use * @param string $mask Mask to use
* @param string $table Table containing field with counter * @param string $table Table containing field with counter
* @param string $field Field containing already used values of counter * @param string $field Field containing already used values of counter
@ -581,8 +581,8 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
* @param Societe $objsoc The company that own the object we need a counter for * @param Societe $objsoc The company that own the object we need a counter for
* @param string $date Date to use for the {y},{m},{d} tags. * @param string $date Date to use for the {y},{m},{d} tags.
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany) * @param bool $bentityon Activate the entity filter. Default is true (for modules not compatible with multicompany)
* @return string New value (numeric) or error message * @return string New value (numeric) or error message
*/ */
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true) function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true)
{ {
@ -784,9 +784,10 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql = "SELECT MAX(".$sqlstring.") as val"; $sql = "SELECT MAX(".$sqlstring.") as val";
$sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'"; $sql.= " AND ".$field." NOT LIKE '(PROV%)'";
if ($bentityon) // only if entity enable if ($bentityon) // only if entity enable
$sql.= " AND entity IN (".getEntity($table, 1).")"; $sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $sql.=$where; if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere; if ($sqlwhere) $sql.=' AND '.$sqlwhere;

View File

@ -900,7 +900,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"])) if (! empty($linkedobject["date_title"]) && ! empty($linkedobject["date_value"]))
{ {
$posy+=7; $posy+=3;
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align); $pdf->MultiCell($w, $h, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', $align);
} }
@ -1273,7 +1273,7 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
* *
* @param Object $object Object * @param Object $object Object
* @param int $i Current line number * @param int $i Current line number
* @param Tranlate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines) * @param int $hidedetails Hide value (0 = no, 1 = yes, 2 = just special lines)
* @return void * @return void
*/ */

View File

@ -384,10 +384,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
else print '</a>'; else print '</a>';
print '</td>'; print '</td>';
// Progress calculated // Progress calculated (Note: ->duration is time spent)
// Note: ->duration is in fact time spent i think
print '<td align="right">'; print '<td align="right">';
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %'; if ($lines[$i]->planned_workload || $lines[$i]->duration)
{
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %';
else print $langs->trans('WorkloadNotDefined');
}
print '</td>'; print '</td>';
// Tick to drag and drop // Tick to drag and drop
@ -430,7 +433,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin'); print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
print '</td>'; print '</td>';
print '<td align="right" class="nowrap liste_total">'; print '<td align="right" class="nowrap liste_total">';
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent_if_planned / $total_projectlinesa_planned,2).' %'; if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned,2).' %';
print '</td>'; print '</td>';
if ($addordertick) print '<td class="hideonsmartphone"></td>'; if ($addordertick) print '<td class="hideonsmartphone"></td>';
print '</tr>'; print '</tr>';
@ -562,13 +565,16 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
$disabledtask=1; $disabledtask=1;
} }
print '<td class="nowrap">'; // Form to add new time
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); print '<td class="nowrap" align="right">';
$s='';
$s.=$form->select_date('',$lines[$i]->id,0,0,2,"addtime",1,0,1,$disabledtask);
$s.='&nbsp;&nbsp;&nbsp;'; $s.='&nbsp;&nbsp;&nbsp;';
$s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text'); $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text',0,1);
$s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">'; $s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
print $s; print $s;
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject")); if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou")); else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));

View File

@ -232,7 +232,7 @@ 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->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&amp;action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&amp;action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&amp;mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __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->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', 'myprojects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&amp;mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __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->projet->enabled', __HANDLER__, 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 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->projet->enabled', __HANDLER__, 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);

View File

@ -1132,12 +1132,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("projects"); $langs->load("projects");
// Project affected to user // Project affected to user
$newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); $newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'myprojects');
$newmenu->add("/projet/card.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $newmenu->add("/projet/card.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/list.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add("/projet/list.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
// All project i have permission on // All project i have permission on
$newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire, '', $mainmenu, 'projects');
$newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer); $newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
$newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);

View File

@ -58,7 +58,7 @@ class modDynamicPrices extends DolibarrModules
// Config pages // Config pages
//------------- //-------------
//$this->config_page_url = array("dynamicprices.php@dynamicprices"); //$this->config_page_url = array();
// Dependancies // Dependancies
//------------- //-------------

View File

@ -44,7 +44,7 @@ interface LogHandlerInterface
/** /**
* Return if logger active * Return if logger active
* *
* @return boolen True if active * @return boolean True if active
*/ */
public function isActive(); public function isActive();

View File

@ -72,11 +72,16 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$link->id = $linkid; $link->id = $linkid;
$link->fetch(); $link->fetch();
$res = $link->delete($user); $res = $link->delete($user);
$langs->load('link'); $langs->load('link');
if ($res) { if ($res > 0) {
setEventMessage($langs->trans("LinkRemoved", $link->label)); setEventMessage($langs->trans("LinkRemoved", $link->label));
} else { } else {
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); if (count($link->errors)) {
setEventMessages('', $link->errors, 'errors');
} else {
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
}
} }
} }
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':'')); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':''));

View File

@ -33,13 +33,13 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
if ($action == 'edit_extras') if ($action == 'edit_extras')
{ {
$value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]);
} }
else else
{ {
$value = $object->array_options ["options_" . $key]; $value = $object->array_options["options_" . $key];
} }
if ($extrafields->attribute_type [$key] == 'separate') if ($extrafields->attribute_type[$key] == 'separate')
{ {
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key);
} }
@ -47,7 +47,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
print '<tr><td>'; print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td'; print '<table width="100%" class="nobordernopadding"><tr><td';
if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"'; //var_dump($action);exit;
if ((! empty($action) && $action != 'view') && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>' . $label . '</td>'; print '>' . $label . '</td>';
//TODO Improve element and rights detection //TODO Improve element and rights detection
@ -67,8 +68,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<td colspan="5">'; print '<td colspan="5">';
// Convert date into timestamp format // Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options['options_' . $key]);
} }
//TODO Improve element and rights detection //TODO Improve element and rights detection
@ -77,7 +78,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">'; print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formextra">';
print '<input type="hidden" name="action" value="update_extras">'; print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">'; print '<input type="hidden" name="attribute" value="' . $key . '">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">'; print '<input type="hidden" name="id" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value); print $extrafields->showInputField($key, $value);

View File

@ -409,7 +409,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); } if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
if (! empty($conf->ficheinter->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } if (! empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); }
$rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers")); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers"));
} }

View File

@ -279,10 +279,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'shipping'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }

View File

@ -113,7 +113,7 @@ class Expedition extends CommonObject
/** /**
* Return next contract ref * Return next contract ref
* *
* @param Societe $soc Objet society * @param Societe $soc Thirdparty object
* @return string Free reference for contract * @return string Free reference for contract
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)
@ -604,9 +604,11 @@ class Expedition extends CommonObject
if (! empty($conf->productbatch->enabled)) { if (! empty($conf->productbatch->enabled)) {
$details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid); $details=ExpeditionLigneBatch::FetchAll($this->db,$obj->rowid);
foreach ($details as $dbatch) { if (! empty($details)) {
$result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty); foreach ($details as $dbatch) {
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; } $result=$mouvS->livraison_batch($dbatch->fk_origin_stock,$dbatch->dluo_qty);
if ($result < 0) { $error++; $this->errors[]=$mouvS->$error; break 2; }
}
} }
} }
} }

View File

@ -117,14 +117,14 @@ if ($resql)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),"ship2bill.php","e.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),"ship2bill.php","s.nom", "", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDeliveryPlanned"),"ship2bill.php","e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder);
if($conf->livraison_bon->enabled) { if($conf->livraison_bon->enabled) {
print_liste_field_titre($langs->trans("DeliveryOrder"),"ship2bill.php","e.date_expedition","",$param, '',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DeliveryOrder"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, '',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateReceived"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
} }
print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -37,6 +37,11 @@ class Fichinter extends CommonObject
public $fk_element='fk_fichinter'; public $fk_element='fk_fichinter';
public $table_element_line='fichinterdet'; public $table_element_line='fichinterdet';
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $socid; // Id client var $socid; // Id client
@ -561,7 +566,7 @@ class Fichinter extends CommonObject
* Returns the next non used reference of intervention * Returns the next non used reference of intervention
* depending on the module numbering assets within FICHEINTER_ADDON * depending on the module numbering assets within FICHEINTER_ADDON
* *
* @param Societe $soc Object society * @param Societe $soc Thirdparty object
* @return string Free reference for intervention * @return string Free reference for intervention
*/ */
function getNextNumRef($soc) function getNextNumRef($soc)

View File

@ -121,7 +121,13 @@ if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$urlparam="&amp;socid=$socid"; $urlparam='';
if ($socid) $urlparam.="&socid=".$socid;
if ($search_ref) $urlparam.="&search_ref=".urlencode($search_ref);
if ($search_company) $urlparam.="&search_company=".urlencode($search_company);
if ($search_desc) $urlparam.="&search_desc=".urlencode($search_desc);
if ($search_status != '' && $search_status > -1) $urlparam.="&search_status=".urlencode($search_status);
print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER['PHP_SELF'], $urlparam, $sortfield, $sortorder, '', $num); print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER['PHP_SELF'], $urlparam, $sortfield, $sortorder, '', $num);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -62,13 +62,17 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if ($action == 'setsupplieraccountancycode') if ($action == 'setsupplieraccountancycode')
{ {
$result=$object->fetch($id); $cancelbutton = GETPOST('cancel');
$object->code_compta_fournisseur=$_POST["supplieraccountancycode"]; if (! $cancelbutton)
$result=$object->update($object->id,$user,1,0,1); {
if ($result < 0) $result=$object->fetch($id);
{ $object->code_compta_fournisseur=$_POST["supplieraccountancycode"];
$mesg=join(',',$object->errors); $result=$object->update($object->id,$user,1,0,1);
} if ($result < 0)
{
$mesg=join(',',$object->errors);
}
}
$action=""; $action="";
} }
// conditions de reglement // conditions de reglement
@ -174,24 +178,15 @@ if ($object->fetch($id))
print '</tr>'; print '</tr>';
// Local Taxes // Local Taxes
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") if ($mysoc->useLocalTax(1))
{ {
print '<tr><td class="nowrap">'.$langs->trans('LocalTax1IsUsedES').'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("LocalTax1IsUsed").'</td><td colspan="3">';
print yn($object->localtax1_assuj);
print '</td></tr>';
print '<tr><td class="nowrap">'.$langs->trans('LocalTax2IsUsedES').'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td></tr>';
}
elseif($mysoc->localtax1_assuj=="1")
{
print '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
print yn($object->localtax1_assuj); print yn($object->localtax1_assuj);
print '</td></tr>'; print '</td></tr>';
} }
elseif($mysoc->localtax2_assuj=="1") if ($mysoc->useLocalTax(2))
{ {
print '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">'; print '<tr><td class="nowrap">'.$langs->trans("LocalTax2IsUsed").'</td><td colspan="3">';
print yn($object->localtax2_assuj); print yn($object->localtax2_assuj);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -45,6 +45,11 @@ class CommandeFournisseur extends CommonOrder
public $fk_element = 'fk_commande'; public $fk_element = 'fk_commande';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $ref; // TODO deprecated var $ref; // TODO deprecated

View File

@ -43,6 +43,11 @@ class FactureFournisseur extends CommonInvoice
public $fk_element='fk_facture_fourn'; public $fk_element='fk_facture_fourn';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $rowid; var $rowid;
var $ref; var $ref;
var $product_ref; var $product_ref;
@ -1493,7 +1498,7 @@ class FactureFournisseur extends CommonInvoice
* Return next reference of supplier invoice not already used (or last reference) * Return next reference of supplier invoice not already used (or last reference)
* according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER * according to numbering module defined into constant INVOICE_SUPPLIER_ADDON_NUMBER
* *
* @param Society $soc object company * @param Societe $soc Thirdparty object
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string free ref or last ref * @return string free ref or last ref
*/ */

View File

@ -357,10 +357,8 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }
@ -462,10 +460,8 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }
@ -526,10 +522,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }

View File

@ -711,10 +711,8 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }
@ -793,10 +791,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }

View File

@ -150,7 +150,7 @@ if ($filter && $filter != -1) // GETPOST('filtre') may be a string
if ($search_ref) if ($search_ref)
{ {
if (is_numeric($search_ref)) $sql .= natural_search(array('fac.rowid', 'fac.ref'), $search_ref);// For backward compatibility if (is_numeric($search_ref)) $sql .= natural_search(array('fac.ref'), $search_ref);
else $sql .= natural_search('fac.ref', $search_ref); else $sql .= natural_search('fac.ref', $search_ref);
} }
if (search_ref_supplier) if (search_ref_supplier)

View File

@ -46,7 +46,7 @@ llxHeader(array(),$langs->trans('CPTitreMenu'));
print_fiche_titre($langs->trans('MenuConfCP')); print_fiche_titre($langs->trans('MenuConfCP'));
$congespayes = new Holidays($db); $congespayes = new Holiday($db);
$listUsers = $congespayes->fetchUsers(false, true); $listUsers = $congespayes->fetchUsers(false, true);
// Si il y a une action de mise à jour // Si il y a une action de mise à jour

View File

@ -22,8 +22,7 @@
*/ */
/** /**
* \class Import * Class to manage imports
* \brief Class to manage imports
*/ */
class Import class Import
{ {
@ -313,10 +312,12 @@ class Import
{ {
if (! $notrigger) if (! $notrigger)
{ {
/* Not used. This is not a business object. To convert it we must herit from CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('IMPORT_DELETE',$user); $result=$this->call_trigger('IMPORT_DELETE',$user);
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
*/
} }
} }

View File

@ -220,8 +220,8 @@ create table llx_accounting_fiscalyear
fk_user_modif integer NULL fk_user_modif integer NULL
)ENGINE=innodb; )ENGINE=innodb;
ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref; ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref;
ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref_ext; ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref_supplier;
ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison; ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison;
ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison; ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison;
@ -1136,6 +1136,8 @@ ALTER TABLE llx_facture_fourn MODIFY COLUMN ref VARCHAR(255);
ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_ext VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_ext VARCHAR(255);
ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_supplier VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_supplier VARCHAR(255);
UPDATE llx_facture_fourn SET ref = rowid WHERE ref IS NULL or ref = '';
ALTER TABLE llx_facture_rec ADD COLUMN revenuestamp double(24,8) DEFAULT 0; ALTER TABLE llx_facture_rec ADD COLUMN revenuestamp double(24,8) DEFAULT 0;
ALTER TABLE llx_facturedet_rec MODIFY COLUMN tva_tx double(6,3); ALTER TABLE llx_facturedet_rec MODIFY COLUMN tva_tx double(6,3);
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL; ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL;

View File

@ -21,6 +21,6 @@ CREATE TABLE IF NOT EXISTS llx_usergroup_extrafields (
tms timestamp, tms timestamp,
fk_object integer NOT NULL, fk_object integer NOT NULL,
import_key varchar(14) -- import key import_key varchar(14) -- import key
) ENGINE=InnoDB ; )ENGINE=innodb;

View File

@ -1157,6 +1157,7 @@ ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes i
FreeLegalTextOnOrders=Free text on orders FreeLegalTextOnOrders=Free text on orders
WatermarkOnDraftOrders=Watermark on draft orders (none if empty) WatermarkOnDraftOrders=Watermark on draft orders (none if empty)
ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable
BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order
##### Clicktodial ##### ##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup ClickToDialSetup=Click To Dial module setup
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags<br><b>__PHONETO__</b> that will be replaced with the phone number of person to call<br><b>__PHONEFROM__</b> that will be replaced with phone number of calling person (yours)<br><b>__LOGIN__</b> that will be replaced with your clicktodial login (defined on your user card)<br><b>__PASS__</b> that will be replaced with your clicktodial password (defined on your user card). ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags<br><b>__PHONETO__</b> that will be replaced with the phone number of person to call<br><b>__PHONEFROM__</b> that will be replaced with phone number of calling person (yours)<br><b>__LOGIN__</b> that will be replaced with your clicktodial login (defined on your user card)<br><b>__PASS__</b> that will be replaced with your clicktodial password (defined on your user card).

View File

@ -28,10 +28,10 @@ ProductsAndServicesStatistics=Products and Services statistics
ProductsStatistics=Products statistics ProductsStatistics=Products statistics
ProductsOnSell=Available products ProductsOnSell=Available products
ProductsNotOnSell=Obsolete products ProductsNotOnSell=Obsolete products
ProductsOnSellAndOnBuy=Products not for sale nor purchase ProductsOnSellAndOnBuy=Products for sale and for purchase
ServicesOnSell=Available services ServicesOnSell=Available services
ServicesNotOnSell=Obsolete services ServicesNotOnSell=Obsolete services
ServicesOnSellAndOnBuy=Services not for sale nor purchase ServicesOnSellAndOnBuy=Services for sale and for purchase
InternalRef=Internal reference InternalRef=Internal reference
LastRecorded=Last products/services on sell recorded LastRecorded=Last products/services on sell recorded
LastRecordedProductsAndServices=Last %s recorded products/services LastRecordedProductsAndServices=Last %s recorded products/services

View File

@ -3,6 +3,7 @@ RefProject=Ref. project
ProjectId=Project Id ProjectId=Project Id
Project=Project Project=Project
Projects=Projects Projects=Projects
ProjectStatus=Project status
SharedProject=Everybody SharedProject=Everybody
PrivateProject=Contacts of project PrivateProject=Contacts of project
MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type). MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type).
@ -11,7 +12,6 @@ ProjectsDesc=This view presents all projects (your user permissions grant you pe
MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type). MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type).
TasksPublicDesc=This view presents all projects and tasks you are allowed to read. TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything). TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
Myprojects=My projects
ProjectsArea=Projects area ProjectsArea=Projects area
NewProject=New project NewProject=New project
AddProject=Create project AddProject=Create project

View File

@ -1,6 +1,6 @@
# Dolibarr language file - Source file is en_US - admin # Dolibarr language file - Source file is en_US - admin
WorkflowSetup=Workflow module setup WorkflowSetup=Workflow module setup
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can enabled automatic actions that you are interesting in. WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can activate the automatic actions that you are interesting in.
ThereIsNoWorkflowToModify=There is no workflow you can modify for module you have activated. ThereIsNoWorkflowToModify=There is no workflow you can modify for module you have activated.
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Create a customer order automatically after a commercial proposal is signed descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Create a customer order automatically after a commercial proposal is signed
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically after a commercial proposal is signed descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically after a commercial proposal is signed

View File

@ -3,6 +3,7 @@ RefProject=Ref. proyecto
ProjectId=Id proyecto ProjectId=Id proyecto
Project=Proyecto Project=Proyecto
Projects=Proyectos Projects=Proyectos
ProjectStatus=Estado del proyecto
SharedProject=Proyecto compartido SharedProject=Proyecto compartido
PrivateProject=Contactos del proyecto PrivateProject=Contactos del proyecto
MyProjectsDesc=Esta vista muestra aquellos proyectos en los que usted es un contacto afectado (cualquier tipo). MyProjectsDesc=Esta vista muestra aquellos proyectos en los que usted es un contacto afectado (cualquier tipo).

View File

@ -204,3 +204,11 @@ ACCOUNTING_ACCOUNT_SUPPLIER=Code comptable par défaut des tiers fournisseurs
CloneTax=Cloner une charge sociale CloneTax=Cloner une charge sociale
ConfirmCloneTax=Confirmer le clonage de la charge sociale ConfirmCloneTax=Confirmer le clonage de la charge sociale
CloneTaxForNextMonth=Cloner pour le mois suivant CloneTaxForNextMonth=Cloner pour le mois suivant
COMPTA_PRODUCT_BUY_ACCOUNT=Code comptable par défaut pour l'achat de produits
COMPTA_PRODUCT_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits
COMPTA_SERVICE_BUY_ACCOUNT=Code comptable par défaut pour l'achat de services
COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de services
COMPTA_VAT_ACCOUNT=Code comptable par défaut pour l'encaissement de TVA
COMPTA_VAT_BUY_ACCOUNT=Code comptable par défaut pour le versement de la TVA
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
COMPTA_ACCOUNT_SUPPLIER=Code comptable par défaut des tiers fournisseurs

View File

@ -135,10 +135,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$model=$object->modelpdf; $model=$object->modelpdf;
if (empty($model)) {
$tmp=getListOfModels($db, 'delivery'); $keys=array_keys($tmp); $model=$keys[0];
}
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
$result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) dol_print_error($db,$result); if ($result < 0) dol_print_error($db,$result);
} }

View File

@ -57,9 +57,9 @@ $pagenext = $page + 1;
$startdate=$enddate=''; $startdate=$enddate='';
if (!empty($_POST['startdatemonth'])) if (!empty($_POST['startdatemonth']))
$startdate = dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
if (!empty($_POST['enddatemonth'])) if (!empty($_POST['enddatemonth']))
$enddate = dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
/* /*
* View * View

View File

@ -93,7 +93,7 @@ llxHeader('',$langs->trans("PaypalSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal'); print_fiche_titre($langs->trans("ModuleSetup").' PayPal',$linkback);
print '<br>'; print '<br>';
$head=paypaladmin_prepare_head(); $head=paypaladmin_prepare_head();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -46,6 +46,11 @@ class Product extends CommonObject
protected $isnolinkedbythird = 1; // No field fk_soc protected $isnolinkedbythird = 1; // No field fk_soc
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff'; var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff';
//! Identifiant unique //! Identifiant unique

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -71,7 +72,9 @@ llxHeader('','',$helpurl);
$sql = "SELECT count(*) as c"; $sql = "SELECT count(*) as c";
$sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " FROM ".MAIN_DB_PREFIX."product";
$sql.= ' WHERE entity IN ('.getEntity('product', 1).')'; $sql.= ' WHERE entity IN ('.getEntity('product', 1).')';
if (isset($type)) $sql.= " AND fk_product_type = ".$type; if ($type !== '') {
$sql.= " AND fk_product_type = ".$type;
}
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)
@ -82,11 +85,14 @@ if ($result)
$param = ''; $param = '';
$title = $langs->trans("ListProductServiceByPopularity"); $title = $langs->trans("ListProductServiceByPopularity");
if (isset($type)) if ($type !== '') {
{
$param = '&amp;type='.$type; $param = '&amp;type='.$type;
$title = $langs->trans("ListProductByPopularity");
if ($type == 1) $title = $langs->trans("ListServiceByPopularity"); if ($type == 1) {
$title = $langs->trans("ListServiceByPopularity");
} else {
$title = $langs->trans("ListProductByPopularity");
}
} }
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,"","","",$num); print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,"","","",$num);
@ -106,7 +112,9 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
$sql.= " AND p.rowid = pd.fk_product"; $sql.= " AND p.rowid = pd.fk_product";
if (isset($type)) $sql.= " AND fk_product_type = ".$type; if ($type !== '') {
$sql.= " AND fk_product_type = ".$type;
}
$sql.= " GROUP BY (p.rowid)"; $sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit, $offset); $sql.= $db->plimit($limit, $offset);

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -155,7 +156,7 @@ if ($id > 0 || ! empty($ref))
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$product->id,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&amp;id=".$product->id,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&amp;id=".$product->id,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&amp;id=".$product->id,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&amp;id=".$product->id,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&amp;id=".$product->id,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&amp;id=".$product->id,'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";

View File

@ -181,7 +181,7 @@ print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>'; print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>'; print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>'; print '<td colspan="2" align="right">'.$langs->trans("NewTimeSpent").'</td>';
print "</tr>\n"; print "</tr>\n";
// By default, we can edit only tasks we are assigned to // By default, we can edit only tasks we are assigned to

View File

@ -38,6 +38,11 @@ class Project extends CommonObject
public $fk_element = 'fk_projet'; public $fk_element = 'fk_projet';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* {@inheritdoc}
*/
protected $table_ref_field = 'ref';
var $id; var $id;
var $ref; var $ref;
var $description; var $description;
@ -568,16 +573,9 @@ class Project extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('PROJECT_DELETE',$user); $result=$this->call_trigger('PROJECT_DELETE',$user);
if ($result < 0)
{ if ($result < 0) {
$error++; $error++;
if (! empty($interface->errors))
{
foreach ($interface->errors as $errmsg ) {
dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
$this->errors[] =$errmsg;
}
}
} }
// End call triggers // End call triggers
} }

View File

@ -460,8 +460,8 @@ $langs->load("suppliers");
$langs->load("bills"); $langs->load("bills");
$langs->load("orders"); $langs->load("orders");
$langs->load("proposals"); $langs->load("proposals");
$langs->load("margin"); $langs->load("margins");
print_titre($langs->trans("Profit")); print_fiche_titre($langs->trans("Profit"),'','');
print '<table class="noborder">'; print '<table class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="left" width="200">'.$langs->trans("Element").'</td>'; print '<td align="left" width="200">'.$langs->trans("Element").'</td>';

View File

@ -57,7 +57,7 @@ $projectstatic = new Project($db);
// Add new contact // Add new contact
if ($action == 'addcontact' && $user->rights->projet->creer) if ($action == 'addcontact' && $user->rights->projet->creer)
{ {
$result = $object->fetch($id); $result = $object->fetch($id, $ref);
if ($result > 0 && $id > 0) if ($result > 0 && $id > 0)
{ {
@ -87,7 +87,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
// bascule du statut d'un contact // bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->projet->creer) if ($action == 'swapstatut' && $user->rights->projet->creer)
{ {
if ($object->fetch($id)) if ($object->fetch($id, $ref))
{ {
$result=$object->swapContactStatus(GETPOST('ligne')); $result=$object->swapContactStatus(GETPOST('ligne'));
} }
@ -100,7 +100,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer)
// Efface un contact // Efface un contact
if ($action == 'deleteline' && $user->rights->projet->creer) if ($action == 'deleteline' && $user->rights->projet->creer)
{ {
$object->fetch($id); $object->fetch($id, $ref);
$result = $object->delete_contact($_GET["lineid"]); $result = $object->delete_contact($_GET["lineid"]);
if ($result >= 0) if ($result >= 0)
@ -152,7 +152,7 @@ $userstatic = new User($db);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
if ($object->fetch($id) > 0) if ($object->fetch($id, $ref) > 0)
{ {
$result=$projectstatic->fetch($object->fk_project); $result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
@ -215,8 +215,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
// To verify role of users // To verify role of users

View File

@ -179,8 +179,6 @@ if ($object->id > 0)
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head = task_prepare_head($object); $head = task_prepare_head($object);

View File

@ -103,7 +103,7 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Project").'</td>'; print '<td>'.$langs->trans("Project").'</td>';
print '<td>'.$langs->trans("Status").'</td>'; print '<td>'.$langs->trans("ProjectStatus").'</td>';
print '<td>'.$langs->trans("RefTask").'</td>'; print '<td>'.$langs->trans("RefTask").'</td>';
print '<td>'.$langs->trans("LabelTask").'</td>'; print '<td>'.$langs->trans("LabelTask").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>'; print '<td align="center">'.$langs->trans("DateStart").'</td>';

View File

@ -161,8 +161,6 @@ if ($object->id > 0)
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head = task_prepare_head($object); $head = task_prepare_head($object);

View File

@ -262,8 +262,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
/* /*

View File

@ -73,7 +73,7 @@ if ($action == 'addtimespent' && $user->rights->projet->creer)
if (! $error) if (! $error)
{ {
$object->fetch($id); $object->fetch($id, $ref);
$object->fetch_projet(); $object->fetch_projet();
if (empty($object->projet->statut)) if (empty($object->projet->statut))
@ -119,7 +119,7 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree
if (! $error) if (! $error)
{ {
$object->fetch($id); $object->fetch($id, $ref);
$object->timespent_id = $_POST["lineid"]; $object->timespent_id = $_POST["lineid"];
$object->timespent_note = $_POST["timespent_note_line"]; $object->timespent_note = $_POST["timespent_note_line"];
@ -194,7 +194,7 @@ if ($id > 0 || ! empty($ref))
/* /*
* Fiche projet en mode visu * Fiche projet en mode visu
*/ */
if ($object->fetch($id) >= 0) if ($object->fetch($id, $ref) >= 0)
{ {
$result=$projectstatic->fetch($object->fk_project); $result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
@ -259,8 +259,6 @@ if ($id > 0 || ! empty($ref))
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<br>';
} }
$head=task_prepare_head($object); $head=task_prepare_head($object);
@ -362,8 +360,7 @@ if ($id > 0 || ! empty($ref))
print '<td>'.$langs->trans("By").'</td>'; print '<td>'.$langs->trans("By").'</td>';
print '<td>'.$langs->trans("Note").'</td>'; print '<td>'.$langs->trans("Note").'</td>';
print '<td>'.$langs->trans("ProgressDeclared").'</td>'; print '<td>'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("Duration").'</td>'; print '<td align="right" colspan="2">'.$langs->trans("NewTimeSpent").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr '.$bc[false].'>'; print '<tr '.$bc[false].'>';
@ -396,7 +393,7 @@ if ($id > 0 || ! empty($ref))
print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress'); print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
print '</td>'; print '</td>';
// Duration // Duration - Time spent
print '<td class="nowrap" align="right">'; print '<td class="nowrap" align="right">';
print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text'); print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text');
print '</td>'; print '</td>';
@ -452,7 +449,7 @@ if ($id > 0 || ! empty($ref))
print '<td width="100">'.$langs->trans("Date").'</td>'; print '<td width="100">'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("By").'</td>'; print '<td>'.$langs->trans("By").'</td>';
print '<td align="left">'.$langs->trans("Note").'</td>'; print '<td align="left">'.$langs->trans("Note").'</td>';
print '<td align="right">'.$langs->trans("Duration").'</td>'; print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -2382,7 +2382,7 @@ class Societe extends CommonObject
* *
* @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm)
* @param string $value Value of profid * @param string $value Value of profid
* @param int $socid Id of society if update * @param int $socid Id of thirdparty if update
* @return boolean true if exists, false if not * @return boolean true if exists, false if not
*/ */
function id_prof_exists($idprof,$value,$socid=0) function id_prof_exists($idprof,$value,$socid=0)

View File

@ -1,2 +1,3 @@
/bootstrap /bootstrap
/oblyon /oblyon
/autre

View File

@ -298,7 +298,7 @@ div.floatright
{ {
float:<?php print $right; ?>; float:<?php print $right; ?>;
} }
div.inline-block .inline-block
{ {
display:inline-block; display:inline-block;
} }

View File

@ -196,7 +196,7 @@ div.floatright
{ {
float:<?php print $right; ?>; float:<?php print $right; ?>;
} }
div.inline-block .inline-block
{ {
display:inline-block; display:inline-block;
} }

View File

@ -221,7 +221,7 @@ div.floatright
{ {
float:<?php print $right; ?>; float:<?php print $right; ?>;
} }
div.inline-block .inline-block
{ {
display:inline-block; display:inline-block;
} }

View File

@ -197,7 +197,7 @@ div.floatright
{ {
float:<?php print $right; ?>; float:<?php print $right; ?>;
} }
div.inline-block .inline-block
{ {
display:inline-block; display:inline-block;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 845 B

Some files were not shown because too many files have changed in this diff Show More