resolve conflict
This commit is contained in:
commit
bdb297a380
@ -2063,9 +2063,10 @@ class Adherent extends CommonObject
|
||||
* @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
|
||||
public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
@ -438,7 +438,6 @@ foreach ($dirmodels as $reldir)
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
|
||||
@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "orders"));
|
||||
$langs->loadLangs(array("admin", "other", "orders", "stocks"));
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@ -561,25 +561,31 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Option to add a quality/validation step, on products, after reception.
|
||||
$langs->load("stocks");
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
|
||||
if ($conf->reception->enabled)
|
||||
{
|
||||
print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
else
|
||||
{
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
|
||||
}
|
||||
}
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Notifications
|
||||
*/
|
||||
|
||||
@ -44,15 +44,18 @@ $object->fetch($id);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('Asset') . " - " . $langs->trans('Info');
|
||||
$helpurl = "";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$object->info($id);
|
||||
|
||||
$head = asset_prepare_head($object);
|
||||
|
||||
@ -101,7 +101,7 @@ class Boms extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
$tmpobject = new BOM($db);
|
||||
|
||||
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
|
||||
$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
|
||||
|
||||
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ if ($action == 'classin' && ($user->rights->agenda->allactions->create ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
}
|
||||
|
||||
// Action clone object
|
||||
@ -165,7 +165,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
reset($object->socpeopleassigned);
|
||||
$object->contactid = key($object->socpeopleassigned);
|
||||
}
|
||||
$result = $object->createFromClone($user, GETPOST('fk_userowner'), GETPOST('socid'));
|
||||
$result = $object->createFromClone($user, GETPOST('socid', 'int'));
|
||||
if ($result > 0) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
|
||||
exit();
|
||||
|
||||
@ -103,7 +103,7 @@ class Proposals extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -107,7 +107,7 @@ class Orders extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -81,8 +81,8 @@ if (count($linkedObjectBlock) > 1)
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td align="center"></td>
|
||||
<td align="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
|
||||
@ -112,7 +112,7 @@ class Invoices extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -239,6 +239,23 @@ if ($id > 0 || $ref)
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Delete'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
/*$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
|
||||
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;*/
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
{
|
||||
@ -298,7 +315,7 @@ if ($id > 0 || $ref)
|
||||
print "<a class=\"butAction\" href=\"card.php?action=setcredited&id=".$object->id."\">".$langs->trans("ClassCredited")."</a>";
|
||||
}
|
||||
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=confirm_delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
@ -356,8 +373,6 @@ if ($id > 0 || $ref)
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($i < min($num, $conf->liste_limit))
|
||||
@ -406,7 +421,10 @@ if ($id > 0 || $ref)
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td class="right">';
|
||||
if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
|
||||
if (empty($offset) && $num <= $limit) // If we have all record on same page, then the following test/warning can be done
|
||||
{
|
||||
if ($total != $object->amount) print img_warning("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines");
|
||||
}
|
||||
print price($total);
|
||||
print "</td>\n";
|
||||
print '<td> </td>';
|
||||
|
||||
@ -739,14 +739,13 @@ class BonPrelevement extends CommonObject
|
||||
$sql = "SELECT count(f.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE f.fk_statut = 1";
|
||||
$sql.= " WHERE f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.rowid = pfd.fk_facture";
|
||||
$sql.= " AND f.paye = 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
|
||||
dol_syslog(get_class($this)."::SommeAPrelever");
|
||||
dol_syslog(get_class($this)."::NbFactureAPrelever");
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ( $resql )
|
||||
@ -759,7 +758,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error();
|
||||
$this->error=get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -798,8 +797,6 @@ class BonPrelevement extends CommonObject
|
||||
$month = strftime("%m", $datetimeprev);
|
||||
$year = strftime("%Y", $datetimeprev);
|
||||
|
||||
$puser = new User($this->db, $conf->global->PRELEVEMENT_USER);
|
||||
|
||||
$this->invoice_in_error = array();
|
||||
$this->thirdparty_in_error = array();
|
||||
|
||||
@ -1631,8 +1628,8 @@ class BonPrelevement extends CommonObject
|
||||
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
||||
{
|
||||
global $langs;
|
||||
$pre = $langs->trans('RUM').'-';
|
||||
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||
$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
|
||||
return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'widthdrawals', 'companies', 'bills'));
|
||||
$langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies', 'bills'));
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -105,6 +105,7 @@ if (empty($reshook))
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$thirdpartystatic=new Societe($db);
|
||||
@ -207,9 +208,11 @@ $sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND pfd.traite = 0";
|
||||
$sql.= " AND pfd.fk_facture = f.rowid";
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if ($socid > 0) $sql.= " AND f.fk_soc = ".$socid;
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
@ -293,7 +296,7 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else print '<tr '.$bc[0].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
else print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print "</table>";
|
||||
print "</form>";
|
||||
print "<br>\n";
|
||||
|
||||
@ -35,31 +35,43 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies'));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$status = GETPOST('status', 'int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
|
||||
|
||||
// Get supervariables
|
||||
$page = GETPOST('page', 'int');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.ref";
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
if (!$status)
|
||||
{
|
||||
$title = $langs->trans("RequestStandingOrderToTreat");
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = $langs->trans("RequestStandingOrderTreated");
|
||||
}
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$thirdpartystatic=new Societe($db);
|
||||
$invoicestatic=new Facture($db);
|
||||
@ -78,95 +90,126 @@ $sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
if (!$statut) $sql.= " AND pfd.traite = 0";
|
||||
if ($statut) $sql.= " AND pfd.traite = ".$statut;
|
||||
if (!$status) $sql.= " AND pfd.traite = 0";
|
||||
if ($status) $sql.= " AND pfd.traite = ".$status;
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND pfd.fk_facture = f.rowid";
|
||||
if (dol_strlen(trim(GETPOST('search_societe', 'alpha'))))
|
||||
{
|
||||
$sql.= natural_search("s.nom", 'search_societe');
|
||||
}
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
$sql.=$db->order($sortfield, $sortorder);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if (!$statut)
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
|
||||
{
|
||||
print_barre_liste($langs->trans("RequestStandingOrderToTreat"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_barre_liste($langs->trans("RequestStandingOrderTreated"), $page, "demandes.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.dol_escape_htmltag(GETPOST('search_facture', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.dol_escape_htmltag(GETPOST('search_societe', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" class="middle">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$users = array();
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$thirdpartystatic->id=$obj->socid;
|
||||
$thirdpartystatic->name=$obj->name;
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords)
|
||||
{
|
||||
$num = $nbtotalofrecords;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$newcardbutton = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/index.php">'.$langs->trans("Back").'</a>';
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit);
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "", "", $param, 'class="right"');
|
||||
print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, 'class="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_facture" size="12" value="'.dol_escape_htmltag(GETPOST('search_facture', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_societe" size="18" value="'.dol_escape_htmltag(GETPOST('search_societe', 'alpha')).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" class="middle">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$users = array();
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) break; // Should not happen
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1, 'withdraw');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$thirdpartystatic->id=$obj->socid;
|
||||
$thirdpartystatic->name=$obj->name;
|
||||
print $thirdpartystatic->getNomUrl(1, 'customer');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->date_demande), 'day').'</td>';
|
||||
|
||||
print '<td class="right"></td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -71,6 +71,7 @@ $thirdpartystatic=new Societe($db);
|
||||
$invoicestatic=new Facture($db);
|
||||
$bprev = new BonPrelevement($db);
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||
|
||||
@ -100,6 +101,8 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
|
||||
$sql.= " WHERE s.rowid = f.fk_soc";
|
||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql.= " AND f.total_ttc > 0";
|
||||
$sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
|
||||
$sql.= " AND pfd.traite = 0 AND pfd.fk_facture = f.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||
|
||||
@ -184,7 +184,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
$remaintopay=price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
|
||||
if ($remaintopay == 0)
|
||||
{
|
||||
$result=$contrib->set_paid($user, '', '');
|
||||
$result=$contrib->set_paid($user);
|
||||
}
|
||||
else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
|
||||
}
|
||||
|
||||
@ -152,7 +152,9 @@ $dolibarr_main_db_collation='utf8_unicode_ci';
|
||||
|
||||
|
||||
// dolibarr_main_instance_unique_id
|
||||
// An ID that is unique for each installation.
|
||||
// An secret ID that is unique for each installation.
|
||||
// This value is also visible and never propagated outside of Dolibarr, so it can be used as a salt / key for some encryption.
|
||||
// To propagate a unique key, you propagate the value concatenated with a string with a hash function. Example: md5('dolibarr'+dolibarr_main_instance_unique_id)
|
||||
// Default value: randomly defined during installation
|
||||
// Examples:
|
||||
// $dolibarr_main_instance_unique_id='84b5bc91f83b56e458db71e0adac2b62';
|
||||
|
||||
@ -108,7 +108,7 @@ class Contracts extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -428,7 +428,7 @@ class CMailFile
|
||||
foreach ($this->images_encoded as $img)
|
||||
{
|
||||
//$img['fullpath'],$img['image_encoded'],$img['name'],$img['content_type'],$img['cid']
|
||||
$attachment = Swift_Image::fromPath($img['fullpath'], $img['content_type']);
|
||||
$attachment = Swift_Image::fromPath($img['fullpath']);
|
||||
// embed image
|
||||
$imgcid = $this->message->embed($attachment);
|
||||
// replace cid by the one created by swiftmail in html message
|
||||
|
||||
@ -4587,10 +4587,15 @@ abstract class CommonObject
|
||||
*/
|
||||
protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = null)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $conf, $langs, $user, $hookmanager;
|
||||
|
||||
$srctemplatepath='';
|
||||
|
||||
$parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams);
|
||||
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if(empty($reshook))
|
||||
{
|
||||
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
|
||||
|
||||
// Increase limit for PDF build
|
||||
@ -4835,6 +4840,8 @@ abstract class CommonObject
|
||||
dol_print_error('', $this->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else return $reshook;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -6608,9 +6615,12 @@ abstract class CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$csstyle='';
|
||||
$class=(!empty($extrafields->attributes[$this->table_element]['hidden'][$key]) ? 'hideobject ' : '');
|
||||
$csstyle='';
|
||||
if (is_array($params) && count($params)>0) {
|
||||
if (array_key_exists('class', $params)) {
|
||||
$class.=$params['class'].' ';
|
||||
}
|
||||
if (array_key_exists('style', $params)) {
|
||||
$csstyle=$params['style'];
|
||||
}
|
||||
@ -6647,16 +6657,19 @@ abstract class CommonObject
|
||||
|
||||
$labeltoshow = $langs->trans($label);
|
||||
|
||||
$out .= '<td class="titlefield';
|
||||
if (GETPOST('action', 'none') == 'create') $out.='create';
|
||||
$out .= '<td class="';
|
||||
//$out .= "titlefield";
|
||||
//if (GETPOST('action', 'none') == 'create') $out.='create';
|
||||
if ($mode != 'view' && ! empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
|
||||
$out .= '">';
|
||||
if (! empty($extrafields->attributes[$object->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$object->table_element]['help'][$key]);
|
||||
if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
|
||||
else $out .= $labeltoshow;
|
||||
$out .= '</td>';
|
||||
|
||||
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
|
||||
|
||||
$out .='<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'" '.($colspan?' colspan="'.$colspan.'"':'').'>';
|
||||
//$out .='<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'">';
|
||||
|
||||
switch($mode) {
|
||||
case "view":
|
||||
@ -6669,6 +6682,11 @@ abstract class CommonObject
|
||||
|
||||
$out .= '</td>';
|
||||
|
||||
/*for($ii = 0; $ii < ($colspan - 1); $ii++)
|
||||
{
|
||||
$out .='<td class="'.$this->element.'_extras_'.$key.'"></td>';
|
||||
}*/
|
||||
|
||||
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= '</tr>';
|
||||
else $out .= '</tr>';
|
||||
$e++;
|
||||
|
||||
@ -552,9 +552,6 @@ class Conf
|
||||
if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1; // use dash between lines
|
||||
if (! isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT=1; // allow html content into free footer text
|
||||
|
||||
// Set default value to MAIN_SHOW_LOGO
|
||||
if (! isset($this->global->MAIN_SHOW_LOGO)) $this->global->MAIN_SHOW_LOGO=1;
|
||||
|
||||
// Default max file size for upload
|
||||
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024);
|
||||
|
||||
|
||||
@ -274,9 +274,10 @@ class ExtraFields
|
||||
* @param string $perms Permission
|
||||
* @param string $list Into list view by default
|
||||
* @param string $computed Computed value
|
||||
* @param string $help Help on tooltip
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '')
|
||||
private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '', $help = '')
|
||||
{
|
||||
if ($elementtype == 'thirdparty') $elementtype='societe';
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
|
||||
@ -63,28 +63,28 @@ class Fiscalyear extends CommonObject
|
||||
* @var string fiscal year label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
|
||||
/**
|
||||
* Date start (date_start)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $date_start;
|
||||
|
||||
|
||||
/**
|
||||
* Date end (date_end)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $date_end;
|
||||
|
||||
|
||||
/**
|
||||
* Date creation record (datec)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $datec;
|
||||
|
||||
|
||||
public $statut; // 0=open, 1=closed
|
||||
|
||||
/**
|
||||
|
||||
@ -3058,7 +3058,7 @@ class lessc_parser {
|
||||
$content[] = $m[1];
|
||||
if ($m[2] == "@{") {
|
||||
$this->count -= strlen($m[2]);
|
||||
if ($this->interpolation($inter, false)) {
|
||||
if ($this->interpolation($inter)) {
|
||||
$content[] = $inter;
|
||||
} else {
|
||||
$this->count += strlen($m[2]);
|
||||
@ -3310,7 +3310,7 @@ class lessc_parser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->interpolation($inter, false)) {
|
||||
if ($this->interpolation($inter)) {
|
||||
$attrParts[] = $inter;
|
||||
$hasInterpolation = true;
|
||||
continue;
|
||||
|
||||
@ -1023,22 +1023,16 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
||||
{
|
||||
case UPLOAD_ERR_INI_SIZE: // 1
|
||||
return 'ErrorFileSizeTooLarge';
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE: // 2
|
||||
return 'ErrorFileSizeTooLarge';
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL: // 3
|
||||
return 'ErrorPartialFile';
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR: //
|
||||
return 'ErrorNoTmpDir';
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
return 'ErrorFailedToWriteInDir';
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
return 'ErrorUploadBlockedByAddon';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
|
||||
|
||||
if (empty($noout)) print_start_menu_array_auguria();
|
||||
|
||||
$usemenuhider = 1;
|
||||
global $usemenuhider;
|
||||
$usemenuhider = 1;
|
||||
|
||||
// Show/Hide vertical menu
|
||||
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
@ -265,8 +265,8 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
|
||||
$mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]);
|
||||
$leftmenu=($forceleftmenu?'':(empty($_SESSION["leftmenu"])?'none':$_SESSION["leftmenu"]));
|
||||
|
||||
$usemenuhider = 0;
|
||||
global $usemenuhider;
|
||||
$usemenuhider = 0;
|
||||
|
||||
// Show logo company
|
||||
if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
|
||||
@ -915,16 +915,16 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
|
||||
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") {
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=0", $langs->trans("StatusSupplierOrderDraftShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
if (empty($conf->global->SUPPLIER_ORDER_HIDE_VALIDATED)) $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=1", $langs->trans("StatusSupplierOrderValidated"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=2", $langs->trans("StatusSupplierOrderApprovedShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=3", $langs->trans("StatusSupplierOrderOnProcessShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=4", $langs->trans("StatusSupplierOrderReceivedPartiallyShort"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=5", $langs->trans("StatusSupplierOrderReceivedAll"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusSupplierOrderCanceled"), 2, $user->rights->fournisseur->commande->lire);
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusSupplierOrderRefused"), 2, $user->rights->fournisseur->commande->lire);
|
||||
}
|
||||
// Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("StatusOrderBilled"), 2, $user->rights->fournisseur->commande->lire);
|
||||
// Billed is another field. We should add instead a dedicated filter on list. if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("Billed"), 2, $user->rights->fournisseur->commande->lire);
|
||||
|
||||
|
||||
$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
|
||||
@ -1580,8 +1580,17 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$langs->load("mrp");
|
||||
|
||||
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom');
|
||||
$newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write);
|
||||
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read);
|
||||
$newmenu->add("/bom/bom_card.php?leftmenu=bom&action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write, '', $mainmenu, 'bom');
|
||||
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read, '', $mainmenu, 'bom');
|
||||
}
|
||||
|
||||
if (! empty($conf->mrp->enabled))
|
||||
{
|
||||
$langs->load("mrp");
|
||||
|
||||
$newmenu->add("", $langs->trans("MenuMRP"), 0, $user->rights->mrp->read, '', $mainmenu, 'mo');
|
||||
$newmenu->add("/mrp/mo_card.php?leftmenu=mo&action=create", $langs->trans("NewMO"), 1, $user->rights->mrp->write, '', $mainmenu, 'mo');
|
||||
$newmenu->add("/mrp/mo_list.php?leftmenu=mo", $langs->trans("List"), 1, $user->rights->mrp->read, '', $mainmenu, 'mo');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,12 +51,15 @@ class MenuManager
|
||||
|
||||
|
||||
/**
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @return void
|
||||
* Load this->tabMenu
|
||||
*
|
||||
* @param string $forcemainmenu To force mainmenu to load
|
||||
* @param string $forceleftmenu To force leftmenu to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadMenu()
|
||||
public function loadMenu($forcemainmenu = '', $forceleftmenu = '')
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -761,7 +761,7 @@ class ImportCsv extends ModeleImports
|
||||
$lastinsertid = $res->rowid;
|
||||
$last_insert_id_array[$tablename] = $lastinsertid;
|
||||
} elseif($resql->num_rows > 1) {
|
||||
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));
|
||||
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters));
|
||||
$this->errors[$error]['type']='SQL';
|
||||
$error++;
|
||||
} else {
|
||||
|
||||
@ -782,7 +782,7 @@ class ImportXlsx extends ModeleImports
|
||||
$lastinsertid = $res->rowid;
|
||||
$last_insert_id_array[$tablename] = $lastinsertid;
|
||||
} elseif($resql->num_rows > 1) {
|
||||
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));
|
||||
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode(', ', $filters));
|
||||
$this->errors[$error]['type']='SQL';
|
||||
$error++;
|
||||
} else {
|
||||
|
||||
@ -93,7 +93,7 @@ class modBlockedLog extends DolibarrModules
|
||||
$this->always_enabled = (!empty($conf->blockedlog->enabled)
|
||||
&& !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)
|
||||
&& in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
|
||||
&& $this->alreadyUsed(1));
|
||||
&& $this->alreadyUsed());
|
||||
|
||||
// Constants
|
||||
//-----------
|
||||
|
||||
@ -187,8 +187,7 @@ class modDataPolicy extends DolibarrModules {
|
||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
|
||||
$this->cronjobs = array(
|
||||
0 => array('label' => 'DATAPOLICY Cron', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'exec', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'),
|
||||
//1 => array('label' => 'DATAPOLICY Mailing', 'jobtype' => 'method', 'class' => '/datapolicy/class/datapolicyCron.class.php', 'objectname' => 'RgpdCron', 'method' => 'sendMailing', 'parameters' => '', 'comment' => 'Comment', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 0, 'test' => true)
|
||||
0 => array('label' => 'DATAPOLICYJob', 'jobtype' => 'method', 'class' => 'datapolicy/class/datapolicycron.class.php', 'objectname' => 'DataPolicyCron', 'method' => 'cleanDataForDataPolicy', 'parameters' => '', 'comment' => 'Clean data', 'frequency' => 1, 'unitfrequency' => 86400, 'status' => 1, 'test' => '$conf->datapolicy->enabled'),
|
||||
);
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
|
||||
|
||||
@ -58,7 +58,7 @@ class modReception extends DolibarrModules
|
||||
// Data directories to create when module is enabled
|
||||
$this->dirs = array("/reception/receipt",
|
||||
"/reception/receipt/temp",
|
||||
"/doctemplates/reception"
|
||||
"/doctemplates/receptions"
|
||||
);
|
||||
|
||||
// Config pages
|
||||
|
||||
@ -121,15 +121,7 @@ class pdf_squille extends ModelePdfReception
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("deliveries");
|
||||
$outputlangs->load("receptions");
|
||||
$outputlangs->load("productbatch");
|
||||
$outputlangs->loadLangs(array("main","dict","companies","bills","products","propal","deliveries","receptions","productbatch","sendings"));
|
||||
|
||||
$nblines = count($object->lines);
|
||||
|
||||
|
||||
@ -208,7 +208,7 @@ if ($permission) {
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->fetch($tab[$i]['id']);
|
||||
echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0, '', 'valignmiddle');
|
||||
echo $contactstatic->getNomUrl(1, '', 0, '', 0, 0);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -375,7 +375,7 @@ if ($nolinesbefore) {
|
||||
{
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat maxwidth75" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref", 'alpha', 2):''); ?>"></td>
|
||||
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref", 'alpha', 2):''); ?>"></td>
|
||||
<?php } ?>
|
||||
|
||||
<td class="nobottom linecolvat right"><?php
|
||||
@ -676,8 +676,19 @@ jQuery(document).ready(function() {
|
||||
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
|
||||
|
||||
jQuery('#trlinefordates').show();
|
||||
<?php
|
||||
if (!empty($conf->global->MAIN_EDIT_PREDEF_PRICEHT))
|
||||
{
|
||||
?>
|
||||
// get the HT price for the product and display it
|
||||
$.post('<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch', { 'id': $(this).val(), 'socid' : <?php print $object->socid; ?> }, function(data) {
|
||||
jQuery("#price_ht").val(data.price_ht);
|
||||
},
|
||||
'json');
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if (! empty($usemargins) && $user->rights->margins->creer)
|
||||
{
|
||||
$langs->load('stocks');
|
||||
@ -839,7 +850,10 @@ function setforpredef() {
|
||||
console.log("Call setforpredef. We hide some fields and show dates");
|
||||
jQuery("#select_type").val(-1);
|
||||
jQuery("#prod_entry_mode_free").prop('checked',false).change();
|
||||
jQuery("#prod_entry_mode_predef").prop('checked',true).change();
|
||||
jQuery("#prod_entry_mode_predef").prop('checked',true).change(
|
||||
<?php if (empty($conf->global->MAIN_EDIT_PREDEF_PRICEHT)) { ?>
|
||||
jQuery("#price_ht").val('').hide();
|
||||
<?php } ?>
|
||||
jQuery("#price_ht").val('')
|
||||
jQuery("#price_ht, #multicurrency_price_ht, #price_ttc, #fourn_ref, #tva_tx, #title_vat, #title_up_ht, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").hide();
|
||||
jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide();
|
||||
|
||||
@ -140,7 +140,7 @@ $coldisplay=0;
|
||||
{
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth75" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
|
||||
<td class="right"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo ($line->ref_supplier ? $line->ref_supplier : $line->ref_fourn); ?>"></td>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ $coldisplay=0;
|
||||
//Line extrafield
|
||||
if (!empty($extrafieldsline))
|
||||
{
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var],'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('class'=>'tredited', 'colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@ -163,6 +163,23 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
|
||||
print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$productfourn = new ProductFournisseur($this->db);
|
||||
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
|
||||
echo '<div class="clearboth"></div><span class="opacitymedium">' . $langs->trans('Supplier') . ' : </span>' . $productfourn->getSocNomUrl(1, 'supplier') . ' - <span class="opacitymedium">' . $langs->trans('Ref') . ' : </span>';
|
||||
// Supplier ref
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here
|
||||
{
|
||||
echo $productfourn->getNomUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $productfourn->ref_supplier;
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0)
|
||||
{
|
||||
|
||||
@ -894,14 +894,15 @@ class Cronjob extends CommonObject
|
||||
/**
|
||||
* Load object information
|
||||
*
|
||||
* @return int
|
||||
* @param int $id ID
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function info()
|
||||
public function info($id)
|
||||
{
|
||||
$sql = "SELECT";
|
||||
$sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f";
|
||||
$sql.= " WHERE f.rowid = ".$this->id;
|
||||
$sql.= " WHERE f.rowid = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -30,6 +30,16 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
*/
|
||||
class DataPolicy
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* getAllContactNotInformed
|
||||
*
|
||||
@ -200,7 +210,6 @@ class DataPolicy
|
||||
} else {
|
||||
$result4 = $mailfile->sendfile();
|
||||
if (!$error) {
|
||||
|
||||
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
|
||||
$contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
|
||||
$contact->update($contact->id);
|
||||
@ -301,6 +310,10 @@ class DataPolicy
|
||||
|
||||
$sendto = $adherent->email;
|
||||
|
||||
// TODO Use a dolibarr email template
|
||||
$s = 'TXTLINKDATAPOLICIESSUBJECT_' . $l;
|
||||
$ma = 'TXTLINKDATAPOLICIESMESSAGE_' . $l;
|
||||
|
||||
$code= md5($adherent->email);
|
||||
if (!empty($adherent->default_lang)) {
|
||||
$l = $adherent->default_lang;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
/**
|
||||
* \file htdocs/datapolicy/class/datapolicycron.class.php
|
||||
* \ingroup datapolicy
|
||||
* \brief Example hook overload.
|
||||
* \brief File for cron task of module DataPolicy
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,17 +27,33 @@
|
||||
*/
|
||||
class DataPolicyCron
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function exec
|
||||
* CAN BE A CRON TASK
|
||||
*
|
||||
* @return boolean
|
||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function exec()
|
||||
public function cleanDataForDataPolicy()
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
$error = 0;
|
||||
$errormsg = '';
|
||||
$nbupdated = $nbdeleted = 0;
|
||||
|
||||
// FIXME Removed hardcoded values of id
|
||||
$arrayofparameters=array(
|
||||
'DATAPOLICIES_TIERS_CLIENT' => array(
|
||||
@ -446,14 +462,18 @@ class DataPolicyCron
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($arrayofparameters as $key => $params) {
|
||||
if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) {
|
||||
$this->db->begin();
|
||||
|
||||
foreach ($arrayofparameters as $key => $params)
|
||||
{
|
||||
if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0)
|
||||
{
|
||||
$sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql && $db->num_rows($resql) > 0) {
|
||||
if ($resql && $db->num_rows($resql) > 0)
|
||||
{
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
@ -461,33 +481,51 @@ class DataPolicyCron
|
||||
require_once $params['file'];
|
||||
$object = new $params['class']($db);
|
||||
|
||||
while ($i < $num)
|
||||
while ($i < $num && ! $error)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$object->fetch($obj->rowid);
|
||||
$object->id = $obj->rowid;
|
||||
|
||||
if ($object->isObjectUsed($obj->rowid) > 0) {
|
||||
if ($object->isObjectUsed($obj->rowid) > 0) // If object to clean is used
|
||||
{
|
||||
foreach ($params['fields_anonym'] as $fields => $val) {
|
||||
$object->$fields = $val;
|
||||
}
|
||||
$object->update($obj->rowid, $user);
|
||||
if ($params['class'] == 'Societe') {
|
||||
// On supprime les contacts associé
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = " . $obj->rowid;
|
||||
$db->query($sql);
|
||||
$result = $object->update($obj->rowid, $user);
|
||||
if ($result > 0)
|
||||
{
|
||||
if ($params['class'] == 'Societe') {
|
||||
// We delete contacts of thirdparty
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = " . $obj->rowid;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result < 0)
|
||||
{
|
||||
$errormsg = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (DOL_VERSION < 8) {
|
||||
$ret = $object->delete($obj->rowid, $user);
|
||||
else
|
||||
{
|
||||
$errormsg = $object->error;
|
||||
$error++;
|
||||
}
|
||||
$nbupdated++;
|
||||
} else { // If object to clean is not used
|
||||
if ($object->element == 'adherent') {
|
||||
$result = $object->delete($obj->rowid, $user);
|
||||
} else {
|
||||
if ($object->element == 'adherent') {
|
||||
$ret = $object->delete($obj->rowid);
|
||||
} else {
|
||||
$ret = $object->delete();
|
||||
}
|
||||
$result = $object->delete($user);
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$errormsg = $object->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$nbdeleted++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
@ -495,27 +533,18 @@ class DataPolicyCron
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
/**
|
||||
* sendMailing
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function sendMailing()
|
||||
{
|
||||
global $conf, $db, $langs, $user;
|
||||
if (! $error)
|
||||
{
|
||||
$this->output = $nbupdated.' record updated, '.$nbdeleted.' record deleted';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = $errormsg;
|
||||
}
|
||||
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
|
||||
|
||||
$contacts = new DataPolicy($db);
|
||||
$contacts->getAllContactNotInformed();
|
||||
$contacts->getAllCompaniesNotInformed();
|
||||
$contacts->getAllAdherentsNotInformed();
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ class Donations extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) ) $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)
|
||||
|
||||
@ -106,7 +106,7 @@ class Shipments extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -101,7 +101,7 @@ class ExpenseReports extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $societe param is ignored and replaced by user's socid
|
||||
//$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe;
|
||||
//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
|
||||
|
||||
$sql = "SELECT t.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as t";
|
||||
|
||||
@ -113,7 +113,7 @@ class Interventions extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -103,7 +103,7 @@ class SupplierOrders extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -639,28 +639,27 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$langs->load('orders');
|
||||
|
||||
$this->statuts[0] = 'StatusOrderDraft';
|
||||
$this->statuts[1] = 'StatusOrderValidated';
|
||||
$this->statuts[2] = 'StatusOrderApproved';
|
||||
if (empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) $this->statuts[3] = 'StatusOrderOnProcess';
|
||||
else $this->statuts[3] = 'StatusOrderOnProcessWithValidation';
|
||||
$this->statuts[4] = 'StatusOrderReceivedPartially';
|
||||
$this->statuts[5] = 'StatusOrderReceivedAll';
|
||||
$this->statuts[6] = 'StatusOrderCanceled'; // Approved->Canceled
|
||||
$this->statuts[7] = 'StatusOrderCanceled'; // Process running->canceled
|
||||
//$this->statuts[8] = 'StatusOrderBilled'; // Everything is finished, order received totally and bill received
|
||||
$this->statuts[9] = 'StatusOrderRefused';
|
||||
$this->statuts[0] = 'StatusSupplierOrderDraft';
|
||||
$this->statuts[1] = 'StatusSupplierOrderValidated';
|
||||
$this->statuts[2] = 'StatusSupplierOrderApproved';
|
||||
if (empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) $this->statuts[3] = 'StatusSupplierOrderOnProcess';
|
||||
else $this->statuts[3] = 'StatusSupplierOrderOnProcessWithValidation';
|
||||
$this->statuts[4] = 'StatusSupplierOrderReceivedPartially';
|
||||
$this->statuts[5] = 'StatusSupplierOrderReceivedAll';
|
||||
$this->statuts[6] = 'StatusSupplierOrderCanceled'; // Approved->Canceled
|
||||
$this->statuts[7] = 'StatusSupplierOrderCanceled'; // Process running->canceled
|
||||
$this->statuts[9] = 'StatusSupplierOrderRefused';
|
||||
|
||||
// List of language codes for status
|
||||
$this->statutshort[0] = 'StatusOrderDraftShort';
|
||||
$this->statutshort[1] = 'StatusOrderValidatedShort';
|
||||
$this->statutshort[2] = 'StatusOrderApprovedShort';
|
||||
$this->statutshort[3] = 'StatusOrderOnProcessShort';
|
||||
$this->statutshort[4] = 'StatusOrderReceivedPartiallyShort';
|
||||
$this->statutshort[5] = 'StatusOrderReceivedAllShort';
|
||||
$this->statutshort[6] = 'StatusOrderCanceledShort';
|
||||
$this->statutshort[7] = 'StatusOrderCanceledShort';
|
||||
$this->statutshort[9] = 'StatusOrderRefusedShort';
|
||||
$this->statutshort[0] = 'StatusSupplierOrderDraftShort';
|
||||
$this->statutshort[1] = 'StatusSupplierOrderValidatedShort';
|
||||
$this->statutshort[2] = 'StatusSupplierOrderApprovedShort';
|
||||
$this->statutshort[3] = 'StatusSupplierOrderOnProcessShort';
|
||||
$this->statutshort[4] = 'StatusSupplierOrderReceivedPartiallyShort';
|
||||
$this->statutshort[5] = 'StatusSupplierOrderReceivedAllShort';
|
||||
$this->statutshort[6] = 'StatusSupplierOrderCanceledShort';
|
||||
$this->statutshort[7] = 'StatusSupplierOrderCanceledShort';
|
||||
$this->statutshort[9] = 'StatusSupplierOrderRefusedShort';
|
||||
}
|
||||
|
||||
$billedtext='';
|
||||
|
||||
@ -939,8 +939,16 @@ if ($id > 0 || ! empty($ref)) {
|
||||
print '<td></td>';
|
||||
print '<td>' . $langs->trans("Warehouse") . '</td>';
|
||||
print '<td>' . $langs->trans("Comment") . '</td>';
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled))
|
||||
|
||||
// Status
|
||||
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) {
|
||||
print '<td class="center" colspan="2">' . $langs->trans("Status") . '</td>';
|
||||
}
|
||||
elseif(!empty($conf->reception->enabled)) {
|
||||
print '<td class="center"></td>';
|
||||
}
|
||||
|
||||
print '<td class="center"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1025,17 +1033,15 @@ if ($id > 0 || ! empty($ref)) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
}elseif(!empty($conf->reception->enabled)){
|
||||
} elseif(!empty($conf->reception->enabled)) {
|
||||
print '<td class="right">';
|
||||
if(!empty($reception->id)){
|
||||
print $reception->getLibStatut(5);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td class="center"></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -55,13 +55,6 @@ $langs->load("holiday");
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
$cancreate = 0;
|
||||
if (! empty($user->rights->holiday->write_all)) $cancreate=1;
|
||||
if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1;
|
||||
|
||||
$candelete = 0;
|
||||
if (! empty($user->rights->holiday->delete)) $candelete=1;
|
||||
|
||||
$morefilter = 'AND employee = 1';
|
||||
if (! empty($conf->global->HOLIDAY_FOR_NON_SALARIES_TOO)) $morefilter = '';
|
||||
|
||||
@ -82,6 +75,13 @@ if ($id > 0)
|
||||
}
|
||||
}
|
||||
|
||||
$cancreate = 0;
|
||||
if (! empty($user->rights->holiday->write_all)) $cancreate=1;
|
||||
if (! empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate=1;
|
||||
|
||||
$candelete = 0;
|
||||
if (! empty($user->rights->holiday->delete)) $candelete=1;
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1435,7 +1435,7 @@ else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
if ($user->rights->holiday->delete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused
|
||||
if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete" class="butActionDelete">'.$langs->trans("DeleteCP").'</a>';
|
||||
}
|
||||
|
||||
@ -41,3 +41,4 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRASSOMPTION', 0, 1, 0, 8, 15, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRTOUSSAINT', 0, 1, 0, 11, 1, 1);
|
||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRARMISTICE', 0, 1, 0, 11, 11, 1);
|
||||
--INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('EASTER', 0, 1, 'easter', 0, 0, 0, 1);
|
||||
|
||||
@ -106,6 +106,7 @@ ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_c_type_co
|
||||
ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
|
||||
ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_socpeople FOREIGN KEY (fk_socpeople) REFERENCES llx_socpeople(rowid);
|
||||
|
||||
ALTER TABLE llx_accounting_account MODIFY COLUMN rowid bigint AUTO_INCREMENT;
|
||||
|
||||
create table llx_c_hrm_public_holiday
|
||||
(
|
||||
@ -121,4 +122,6 @@ create table llx_c_hrm_public_holiday
|
||||
import_key varchar(14)
|
||||
)ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_start datetime DEFAULT NULL;
|
||||
ALTER TABLE llx_supplier_proposaldet ADD COLUMN date_end datetime DEFAULT NULL;
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
create table llx_accounting_account
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
rowid bigint AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
|
||||
@ -40,6 +40,8 @@ CREATE TABLE llx_supplier_proposaldet (
|
||||
total_localtax2 double(24,8) DEFAULT 0,
|
||||
total_ttc double(24,8) DEFAULT 0,
|
||||
product_type integer DEFAULT 0,
|
||||
date_start datetime DEFAULT NULL, -- date debut si service
|
||||
date_end datetime DEFAULT NULL, -- date fin si service
|
||||
info_bits integer DEFAULT 0,
|
||||
buy_price_ht double(24,8) DEFAULT 0,
|
||||
fk_product_fournisseur_price integer DEFAULT NULL,
|
||||
|
||||
@ -218,7 +218,7 @@ DoliStoreDesc=DoliStore, the official market place for Dolibarr ERP/CRM external
|
||||
DoliPartnersDesc=List of companies providing custom-developed modules or features.<br>Note: since Dolibarr is an open source application, <i>anyone</i> experienced in PHP programming may develop a module.
|
||||
WebSiteDesc=External websites for more add-on (non-core) modules...
|
||||
DevelopYourModuleDesc=Some solutions to develop your own module...
|
||||
URL=Link
|
||||
URL=URL
|
||||
BoxesAvailable=Widgets available
|
||||
BoxesActivated=Widgets activated
|
||||
ActivateOn=Activate on
|
||||
@ -1940,4 +1940,5 @@ RESTRICT_API_ON_IP=Allow available APIs to some host IP only (wildcard not allow
|
||||
RESTRICT_ON_IP=Allow access to some host IP only (wildcard not allowed, use space between values). Empty means every hosts can access.
|
||||
BaseOnSabeDavVersion=Based on the library SabreDAV version
|
||||
NotAPublicIp=Not a public IP
|
||||
MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation.
|
||||
MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server (done 1 time only after installation) to allow the foundation to count the number of Dolibarr installation.
|
||||
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
|
||||
|
||||
@ -81,3 +81,4 @@ JobDisabled=Job disabled
|
||||
MakeLocalDatabaseDumpShort=Local database backup
|
||||
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
||||
DATAPOLICYJob=Data cleaner and anonymizer
|
||||
|
||||
@ -825,6 +825,7 @@ Mandatory=Mandatory
|
||||
Hello=Hello
|
||||
GoodBye=GoodBye
|
||||
Sincerely=Sincerely
|
||||
ConfirmDeleteObject=Are you sure you want to delete this object?
|
||||
DeleteLine=Delete line
|
||||
ConfirmDeleteLine=Are you sure you want to delete this line?
|
||||
NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record
|
||||
|
||||
@ -15,3 +15,5 @@ ManufacturingEfficiency=Manufacturing efficiency
|
||||
ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production
|
||||
DeleteBillOfMaterials=Delete Bill Of Materials
|
||||
ConfirmDeleteBillOfMaterials=Are you sure you want to delete this Bill Of Material?
|
||||
MenuMRP=Manufacturing Orders
|
||||
NewMO=New Manufacturing Order
|
||||
@ -37,7 +37,6 @@ StatusOrderDeliveredShort=Delivered
|
||||
StatusOrderToBillShort=Delivered
|
||||
StatusOrderApprovedShort=Approved
|
||||
StatusOrderRefusedShort=Refused
|
||||
StatusOrderBilledShort=Billed
|
||||
StatusOrderToProcessShort=To process
|
||||
StatusOrderReceivedPartiallyShort=Partially received
|
||||
StatusOrderReceivedAllShort=Products received
|
||||
@ -50,7 +49,6 @@ StatusOrderProcessed=Processed
|
||||
StatusOrderToBill=Delivered
|
||||
StatusOrderApproved=Approved
|
||||
StatusOrderRefused=Refused
|
||||
StatusOrderBilled=Billed
|
||||
StatusOrderReceivedPartially=Partially received
|
||||
StatusOrderReceivedAll=All products received
|
||||
ShippingExist=A shipment exists
|
||||
@ -156,3 +154,31 @@ OptionToSetOrderBilledNotEnabled=Option (from module Workflow) to set order to '
|
||||
IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated.
|
||||
CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received.
|
||||
SetShippingMode=Set shipping mode
|
||||
|
||||
#### supplier orders status
|
||||
StatusSupplierOrderCanceledShort=Canceled
|
||||
StatusSupplierOrderDraftShort=Draft
|
||||
StatusSupplierOrderValidatedShort=Validated
|
||||
StatusSupplierOrderSentShort=In process
|
||||
StatusSupplierOrderSent=Shipment in process
|
||||
StatusSupplierOrderOnProcessShort=Ordered
|
||||
StatusSupplierOrderProcessedShort=Processed
|
||||
StatusSupplierOrderDelivered=Delivered
|
||||
StatusSupplierOrderDeliveredShort=Delivered
|
||||
StatusSupplierOrderToBillShort=Delivered
|
||||
StatusSupplierOrderApprovedShort=Approved
|
||||
StatusSupplierOrderRefusedShort=Refused
|
||||
StatusSupplierOrderToProcessShort=To process
|
||||
StatusSupplierOrderReceivedPartiallyShort=Partially received
|
||||
StatusSupplierOrderReceivedAllShort=Products received
|
||||
StatusSupplierOrderCanceled=Canceled
|
||||
StatusSupplierOrderDraft=Draft (needs to be validated)
|
||||
StatusSupplierOrderValidated=Validated
|
||||
StatusSupplierOrderOnProcess=Ordered - Standby reception
|
||||
StatusSupplierOrderOnProcessWithValidation=Ordered - Standby reception or validation
|
||||
StatusSupplierOrderProcessed=Processed
|
||||
StatusSupplierOrderToBill=Delivered
|
||||
StatusSupplierOrderApproved=Approved
|
||||
StatusSupplierOrderRefused=Refused
|
||||
StatusSupplierOrderReceivedPartially=Partially received
|
||||
StatusSupplierOrderReceivedAll=All products received
|
||||
@ -76,7 +76,7 @@ WithdrawalFile=Withdrawal file
|
||||
SetToStatusSent=Set to status "File Sent"
|
||||
ThisWillAlsoAddPaymentOnInvoice=This will also record payments to invoices and will classify them as "Paid" if remain to pay is null
|
||||
StatisticsByLineStatus=Statistics by status of lines
|
||||
RUM=Unique Mandate Reference (UMR)
|
||||
RUM=UMR
|
||||
DateRUM=Mandate signature date
|
||||
RUMLong=Unique Mandate Reference
|
||||
RUMWillBeGenerated=If empty, a UMR (Unique Mandate Reference) will be generated once the bank account information is saved.
|
||||
|
||||
@ -156,3 +156,33 @@ OptionToSetOrderBilledNotEnabled=L'option (issue du module Workflow) pour défin
|
||||
IfValidateInvoiceIsNoOrderStayUnbilled=Si la validation de facture est à "Non", la commande restera au statut "Non facturé" jusqu'à ce que la facture soit validée.
|
||||
CloseReceivedSupplierOrdersAutomatically=Fermer la commande au statut "%s" automatiquement si tous les produits ont été reçus.
|
||||
SetShippingMode=Définir la méthode d'expédition
|
||||
|
||||
###### statuts commandes fournisseurs
|
||||
StatusSupplierOrderCanceledShort=Annulée
|
||||
StatusSupplierOrderDraftShort=Brouillon
|
||||
StatusSupplierOrderValidatedShort=Validée
|
||||
StatusSupplierOrderSentShort=En cours
|
||||
StatusSupplierOrderSent=Envoi en cours
|
||||
StatusSupplierOrderOnProcessShort=Commandé
|
||||
StatusSupplierOrderProcessedShort=Traitée
|
||||
StatusSupplierOrderDelivered=Livrée
|
||||
StatusSupplierOrderDeliveredShort=Livrée
|
||||
StatusSupplierOrderToBillShort=Livré
|
||||
StatusSupplierOrderApprovedShort=Approuvée
|
||||
StatusSupplierOrderRefusedShort=Refusée
|
||||
StatusSupplierOrderBilledShort=Facturée
|
||||
StatusSupplierOrderToProcessShort=À traiter
|
||||
StatusSupplierOrderReceivedPartiallyShort=Reçue partiellement
|
||||
StatusSupplierOrderReceivedAllShort=Produits reçus
|
||||
StatusSupplierOrderCanceled=Annulée
|
||||
StatusSupplierOrderDraft=Brouillon (à valider)
|
||||
StatusSupplierOrderValidated=Validée
|
||||
StatusSupplierOrderOnProcess=Commandé - en attente de réception
|
||||
StatusSupplierOrderOnProcessWithValidation=Commandé - en attente de réception ou validation
|
||||
StatusSupplierOrderProcessed=Traitée
|
||||
StatusSupplierOrderToBill=Livrée
|
||||
StatusSupplierOrderApproved=Approuvée
|
||||
StatusSupplierOrderRefused=Refusée
|
||||
StatusSupplierOrderBilled=Facturée
|
||||
StatusSupplierOrderReceivedPartially=Reçue partiellement
|
||||
StatusSupplierOrderReceivedAll=Tous les produits reçus
|
||||
|
||||
@ -2195,7 +2195,7 @@ elseif (! empty($module))
|
||||
print '<td>';
|
||||
print $proptype;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="wordbreak">';
|
||||
if ($proparrayofkeyval) {
|
||||
print json_encode($proparrayofkeyval);
|
||||
}
|
||||
@ -2344,7 +2344,7 @@ elseif (! empty($module))
|
||||
{
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
|
||||
//$menus = $moduleobj->;
|
||||
$menus = $moduleobj->menu;
|
||||
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
@ -2361,9 +2361,6 @@ elseif (! empty($module))
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("ListOfMenusEntries"), '', '');
|
||||
|
||||
// @TODO
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
@ -2371,77 +2368,90 @@ elseif (! empty($module))
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
/*
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Menu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("fk_menu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("perms", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
if (count($menus))
|
||||
{
|
||||
foreach ($cronjobs as $cron)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
if (count($menus))
|
||||
{
|
||||
foreach ($menus as $menu)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $cron['label'];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $menu['type'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($cron['jobtype']=='method')
|
||||
{
|
||||
$text=$langs->trans("CronClass");
|
||||
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
||||
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
elseif ($cron['jobtype']=='command')
|
||||
{
|
||||
$text=$langs->trans('CronCommand');
|
||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $menu['fk_menu'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
||||
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
||||
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
||||
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $menu['titre'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $cron['status'];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $menu['mainmenu'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if (!empty($cron['comment'])) {print $cron['comment'];}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $menu['left'];
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
print '<td>';
|
||||
print $menu['url'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['langs'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['position'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['enabled'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['perms'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['target'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['user'];
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2474,7 +2484,7 @@ elseif (! empty($module))
|
||||
{
|
||||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
|
||||
//$perms = $moduleobj->;
|
||||
$perms = $moduleobj->rights;
|
||||
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
@ -2492,10 +2502,6 @@ elseif (! empty($module))
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("ListOfPermissionsDefined"), '', '');
|
||||
|
||||
|
||||
// @TODO
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
@ -2503,77 +2509,50 @@ elseif (! empty($module))
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
/*
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("CronLabel",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
if (count($cronjobs))
|
||||
{
|
||||
foreach ($cronjobs as $cron)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
if (count($perms))
|
||||
{
|
||||
foreach ($perms as $perm)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $cron['label'];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $perm[0];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($cron['jobtype']=='method')
|
||||
{
|
||||
$text=$langs->trans("CronClass");
|
||||
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
||||
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
elseif ($cron['jobtype']=='command')
|
||||
{
|
||||
$text=$langs->trans('CronCommand');
|
||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $perm[1];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
||||
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
||||
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
||||
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $perm[4];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $cron['status'];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $perm[5];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if (!empty($cron['comment'])) {print $cron['comment'];}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="4">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
*/
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -111,7 +111,7 @@ class MyModuleApi extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
|
||||
$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
|
||||
|
||||
$restrictonsocid = 0; // Set to 1 if there is a field socid in table of object
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
// Confirmation to delete line
|
||||
if ($action == 'deleteline')
|
||||
|
||||
@ -116,7 +116,7 @@ class Products extends DolibarrApi
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
|
||||
$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
|
||||
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as t";
|
||||
|
||||
@ -105,7 +105,7 @@ class Projects extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -113,7 +113,7 @@ class Tasks extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -15,6 +16,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || ! is_object($conf))
|
||||
{
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
@ -22,41 +31,47 @@
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("receptions");
|
||||
|
||||
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$var=true;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass=($var?'pair':'impair');
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>">
|
||||
<td><?php echo $langs->trans("Reception"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
||||
<td class="right"><?php
|
||||
<td class="linkedcol-element"><?php echo $langs->trans("Reception"); ?>
|
||||
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
|
||||
</td>
|
||||
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"></td>
|
||||
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
if ($user->rights->reception->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="right">
|
||||
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
|
||||
<td class="linkedcol-action right">
|
||||
<?php
|
||||
// For now, receptions must stay linked to order, so link is not deletable
|
||||
if($object->element != 'order_supplier') {
|
||||
?>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ class Thirdparties extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, we force socids
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -357,7 +357,7 @@ if (empty($reshook))
|
||||
$array_options = $lines[$i]->array_options;
|
||||
}
|
||||
|
||||
$result = $object->addline(
|
||||
$result = $object->addline(
|
||||
$desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx,
|
||||
$lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx,
|
||||
$lines[$i]->fk_product, $lines[$i]->remise_percent,
|
||||
@ -646,6 +646,9 @@ if (empty($reshook))
|
||||
$pu_ht = $productsupplier->fourn_pu;
|
||||
if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value
|
||||
|
||||
$fournprice = 0;
|
||||
$buyingprice = 0;
|
||||
|
||||
$result=$object->addline(
|
||||
$desc,
|
||||
$pu_ht,
|
||||
@ -670,9 +673,17 @@ if (empty($reshook))
|
||||
$productsupplier->fk_unit,
|
||||
'',
|
||||
0,
|
||||
$productsupplier->fourn_multicurrency_unitprice
|
||||
$productsupplier->fourn_multicurrency_unitprice,
|
||||
$date_start,
|
||||
$date_end
|
||||
);
|
||||
|
||||
//var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit;
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
if ($idprod == -99 || $idprod == 0)
|
||||
{
|
||||
@ -1756,7 +1767,7 @@ if ($action == 'create')
|
||||
if (! empty($conf->global->SUPPLIER_PROPOSAL_WITH_PREDEFINED_PRICES_ONLY)) $senderissupplier=1;
|
||||
|
||||
if (! empty($object->lines))
|
||||
$ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, 1);
|
||||
$ret = $object->printObjectLines($action, $soc, $mysoc, $lineid, $dateSelector);
|
||||
|
||||
// Form to add new line
|
||||
if ($object->statut == SupplierProposal::STATUS_DRAFT && $user->rights->supplier_proposal->creer)
|
||||
@ -1764,7 +1775,7 @@ if ($action == 'create')
|
||||
if ($action != 'editline')
|
||||
{
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $soc, $mysoc);
|
||||
$object->formAddObjectLine($dateSelector, $soc, $mysoc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -101,7 +101,7 @@ class Supplierproposals extends DolibarrApi
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
$socids = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $thirdparty_ids;
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
|
||||
@ -324,9 +324,6 @@ class SupplierProposal extends CommonObject
|
||||
$supplier_proposalligne->rang=-1;
|
||||
$supplier_proposalligne->info_bits=2;
|
||||
|
||||
// TODO deprecated
|
||||
$supplier_proposalligne->price=-$remise->amount_ht;
|
||||
|
||||
$supplier_proposalligne->total_ht = -$remise->amount_ht;
|
||||
$supplier_proposalligne->total_tva = -$remise->amount_tva;
|
||||
$supplier_proposalligne->total_ttc = -$remise->amount_ttc;
|
||||
@ -391,11 +388,13 @@ class SupplierProposal extends CommonObject
|
||||
* @param string $origin 'order', 'supplier_proposal', ...
|
||||
* @param int $origin_id Id of origin line
|
||||
* @param double $pu_ht_devise Amount in currency
|
||||
* @param int $date_start Date start
|
||||
* @param int $date_end Date end
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*
|
||||
* @see add_product()
|
||||
*/
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $pu_ttc = 0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $array_option = 0, $ref_supplier = '', $fk_unit = '', $origin = '', $origin_id = 0, $pu_ht_devise = 0)
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $pu_ttc = 0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $array_option = 0, $ref_supplier = '', $fk_unit = '', $origin = '', $origin_id = 0, $pu_ht_devise = 0, $date_start = 0, $date_end = 0)
|
||||
{
|
||||
global $mysoc, $conf;
|
||||
|
||||
@ -570,6 +569,8 @@ class SupplierProposal extends CommonObject
|
||||
$this->line->origin=$origin;
|
||||
$this->line->origin_id=$origin_id;
|
||||
$this->line->ref_fourn = $this->db->escape($ref_supplier);
|
||||
$this->line->date_start = $date_start;
|
||||
$this->line->date_end = $date_end;
|
||||
|
||||
// infos marge
|
||||
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
|
||||
@ -594,10 +595,6 @@ class SupplierProposal extends CommonObject
|
||||
// Mise en option de la ligne
|
||||
if (empty($qty) && empty($special_code)) $this->line->special_code=3;
|
||||
|
||||
// TODO deprecated
|
||||
$this->line->price=$price;
|
||||
$this->line->remise=$remise;
|
||||
|
||||
if (is_array($array_option) && count($array_option)>0) {
|
||||
$this->line->array_options=$array_option;
|
||||
}
|
||||
@ -613,7 +610,7 @@ class SupplierProposal extends CommonObject
|
||||
if ($result > 0)
|
||||
{
|
||||
$this->db->commit();
|
||||
return $this->line->rowid;
|
||||
return $this->line->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -629,6 +626,11 @@ class SupplierProposal extends CommonObject
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = 'BadStatusOfObjectToAddLine';
|
||||
return -5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -688,6 +690,7 @@ class SupplierProposal extends CommonObject
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $mysoc, $this->thirdparty);
|
||||
|
||||
// Clean vat code
|
||||
$reg = array();
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
@ -707,14 +710,6 @@ class SupplierProposal extends CommonObject
|
||||
$multicurrency_total_tva = $tabprice[17];
|
||||
$multicurrency_total_ttc = $tabprice[18];
|
||||
|
||||
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
|
||||
$price = $pu;
|
||||
if ($remise_percent > 0)
|
||||
{
|
||||
$remise = round(($pu * $remise_percent / 100), 2);
|
||||
$price = $pu - $remise;
|
||||
}
|
||||
|
||||
// Update line
|
||||
$this->line=new SupplierProposalLine($this->db);
|
||||
|
||||
@ -730,7 +725,7 @@ class SupplierProposal extends CommonObject
|
||||
$this->line->rang = $rangmax + 1;
|
||||
}
|
||||
|
||||
$this->line->rowid = $rowid;
|
||||
$this->line->id = $rowid;
|
||||
$this->line->label = $label;
|
||||
$this->line->desc = $desc;
|
||||
$this->line->qty = $qty;
|
||||
@ -768,10 +763,6 @@ class SupplierProposal extends CommonObject
|
||||
}
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// TODO deprecated
|
||||
$this->line->price=$price;
|
||||
$this->line->remise=$remise;
|
||||
|
||||
if (is_array($array_option) && count($array_option)>0) {
|
||||
$this->line->array_options=$array_option;
|
||||
}
|
||||
@ -791,7 +782,6 @@ class SupplierProposal extends CommonObject
|
||||
$this->update_price(1);
|
||||
|
||||
$this->fk_supplier_proposal = $this->id;
|
||||
$this->rowid = $rowid;
|
||||
|
||||
$this->db->commit();
|
||||
return $result;
|
||||
@ -1357,7 +1347,6 @@ class SupplierProposal extends CommonObject
|
||||
$line->subprice = $objp->subprice;
|
||||
$line->fk_remise_except = $objp->fk_remise_except;
|
||||
$line->remise_percent = $objp->remise_percent;
|
||||
$line->price = $objp->price; // TODO deprecated
|
||||
|
||||
$line->info_bits = $objp->info_bits;
|
||||
$line->total_ht = $objp->total_ht;
|
||||
@ -2371,7 +2360,6 @@ class SupplierProposal extends CommonObject
|
||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||
$line->qty=1;
|
||||
$line->subprice=100;
|
||||
$line->price=100;
|
||||
$line->tva_tx=19.6;
|
||||
$line->localtax1_tx=0;
|
||||
$line->localtax2_tx=0;
|
||||
@ -2745,9 +2733,6 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
|
||||
public $oldline;
|
||||
|
||||
// From llx_supplier_proposaldet
|
||||
public $rowid; // deprecated
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
@ -2813,20 +2798,11 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
|
||||
|
||||
public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
|
||||
public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see remise_percent, fk_remise_except
|
||||
*/
|
||||
public $remise;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see subprice
|
||||
*/
|
||||
public $price;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
|
||||
// From llx_product
|
||||
/**
|
||||
@ -2902,6 +2878,7 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT pd.rowid, pd.fk_supplier_proposal, pd.fk_parent_line, pd.fk_product, pd.label as custom_label, pd.description, pd.price, pd.qty, pd.tva_tx,';
|
||||
$sql.= ' pd.date_start, pd.date_end,';
|
||||
$sql.= ' pd.remise, pd.remise_percent, pd.fk_remise_except, pd.subprice,';
|
||||
$sql.= ' pd.info_bits, pd.total_ht, pd.total_tva, pd.total_ttc, pd.fk_product_fournisseur_price as fk_fournprice, pd.buy_price_ht as pa_ht, pd.special_code, pd.rang,';
|
||||
$sql.= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,';
|
||||
@ -2917,21 +2894,20 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->rowid = $objp->rowid; // deprecated
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_supplier_proposal = $objp->fk_supplier_proposal;
|
||||
$this->fk_parent_line = $objp->fk_parent_line;
|
||||
$this->label = $objp->custom_label;
|
||||
$this->desc = $objp->description;
|
||||
$this->qty = $objp->qty;
|
||||
$this->price = $objp->price; // deprecated
|
||||
$this->subprice = $objp->subprice;
|
||||
$this->tva_tx = $objp->tva_tx;
|
||||
$this->remise = $objp->remise;
|
||||
$this->remise_percent = $objp->remise_percent;
|
||||
$this->fk_remise_except = $objp->fk_remise_except;
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
@ -3028,6 +3004,7 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
// Insert line into database
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'supplier_proposaldet';
|
||||
$sql.= ' (fk_supplier_proposal, fk_parent_line, label, description, fk_product, product_type,';
|
||||
$sql.= ' date_start, date_end,';
|
||||
$sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,';
|
||||
$sql.= ' subprice, remise_percent, ';
|
||||
$sql.= ' info_bits, ';
|
||||
@ -3040,6 +3017,8 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$sql.= " '".$this->db->escape($this->desc)."',";
|
||||
$sql.= " ".($this->fk_product?"'".$this->db->escape($this->fk_product)."'":"null").",";
|
||||
$sql.= " '".$this->db->escape($this->product_type)."',";
|
||||
$sql.= " ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null").",";
|
||||
$sql.= " ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null").",";
|
||||
$sql.= " ".($this->fk_remise_except?"'".$this->db->escape($this->fk_remise_except)."'":"null").",";
|
||||
$sql.= " ".price2num($this->qty).",";
|
||||
$sql.= " ".price2num($this->tva_tx).",";
|
||||
@ -3073,8 +3052,7 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet');
|
||||
$this->id=$this->rowid;
|
||||
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet');
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
@ -3120,7 +3098,7 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE rowid = ".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."supplier_proposaldet WHERE rowid = ".$this->id;
|
||||
dol_syslog("SupplierProposalLine::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
@ -3128,7 +3106,6 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
// Remove extrafields
|
||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
|
||||
{
|
||||
$this->id=$this->rowid;
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -3180,8 +3157,6 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
if (empty($this->localtax2_type)) $this->localtax2_type=0;
|
||||
if (empty($this->marque_tx)) $this->marque_tx=0;
|
||||
if (empty($this->marge_tx)) $this->marge_tx=0;
|
||||
if (empty($this->price)) $this->price=0; // TODO A virer
|
||||
if (empty($this->remise)) $this->remise=0; // TODO A virer
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
@ -3212,6 +3187,8 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$sql.= " description='".$this->db->escape($this->desc)."'";
|
||||
$sql.= " , label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null");
|
||||
$sql.= " , product_type=".$this->product_type;
|
||||
$sql.= " , date_start=".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : "null");
|
||||
$sql.= " , date_end=".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||
$sql.= " , tva_tx='".price2num($this->tva_tx)."'";
|
||||
$sql.= " , localtax1_tx=".price2num($this->localtax1_tx);
|
||||
$sql.= " , localtax2_tx=".price2num($this->localtax2_tx);
|
||||
@ -3220,8 +3197,6 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$sql.= " , qty='".price2num($this->qty)."'";
|
||||
$sql.= " , subprice=".price2num($this->subprice)."";
|
||||
$sql.= " , remise_percent=".price2num($this->remise_percent)."";
|
||||
$sql.= " , price=".price2num($this->price).""; // TODO A virer
|
||||
$sql.= " , remise=".price2num($this->remise).""; // TODO A virer
|
||||
$sql.= " , info_bits='".$this->db->escape($this->info_bits)."'";
|
||||
if (empty($this->skip_update_total))
|
||||
{
|
||||
@ -3245,7 +3220,7 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
$sql.= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva)."";
|
||||
$sql.= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc)."";
|
||||
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -3253,7 +3228,6 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
{
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$this->id=$this->rowid;
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -3298,10 +3272,10 @@ class SupplierProposalLine extends CommonObjectLine
|
||||
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposaldet SET";
|
||||
$sql.= " total_ht=".price2num($this->total_ht, 'MT')."";
|
||||
$sql.= ",total_tva=".price2num($this->total_tva, 'MT')."";
|
||||
$sql.= ",total_ttc=".price2num($this->total_ttc, 'MT')."";
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
$sql.= " total_ht=".price2num($this->total_ht, 'MT');
|
||||
$sql.= ",total_tva=".price2num($this->total_tva, 'MT');
|
||||
$sql.= ",total_ttc=".price2num($this->total_ttc, 'MT');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("SupplierProposalLine::update_total", LOG_DEBUG);
|
||||
|
||||
|
||||
@ -234,8 +234,8 @@ class Tickets extends DolibarrApi
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
if (!$socid && DolibarrApiAccess::$user->societe_id) {
|
||||
$socid = DolibarrApiAccess::$user->societe_id;
|
||||
if (!$socid && DolibarrApiAccess::$user->socid) {
|
||||
$socid = DolibarrApiAccess::$user->socid;
|
||||
}
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
|
||||
@ -76,7 +76,7 @@ class Users extends DolibarrApi
|
||||
}
|
||||
|
||||
// case of external user, $societe param is ignored and replaced by user's socid
|
||||
//$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $societe;
|
||||
//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
|
||||
|
||||
$sql = "SELECT t.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as t";
|
||||
|
||||
@ -705,7 +705,7 @@ if ($action == 'addcontainer')
|
||||
getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php';
|
||||
$lesscobj = new lessc();
|
||||
$lesscobj = new Lessc();
|
||||
try {
|
||||
$contentforlessc = ".bodywebsite {\n".$tmpgeturl['content']."\n}\n";
|
||||
//print '<pre>'.$contentforlessc.'</pre>';
|
||||
|
||||
@ -87,6 +87,8 @@ class AllTests
|
||||
$suite->addTestSuite('DateLibTest');
|
||||
require_once dirname(__FILE__).'/UtilsTest.php';
|
||||
$suite->addTestSuite('UtilsTest');
|
||||
require_once dirname(__FILE__).'/LesscTest.php';
|
||||
$suite->addTestSuite('LesscTest');
|
||||
//require_once dirname(__FILE__).'/DateLibTzFranceTest.php';
|
||||
//$suite->addTestSuite('DateLibTzFranceTest');
|
||||
require_once dirname(__FILE__).'/MarginsLibTest.php';
|
||||
|
||||
181
test/phpunit/LesscTest.php
Normal file
181
test/phpunit/LesscTest.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/LessTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
*/
|
||||
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php';
|
||||
|
||||
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
|
||||
if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no menu to show
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
|
||||
|
||||
if (empty($user->id))
|
||||
{
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
}
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class LesscTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @return SecurityTest
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// Static methods
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
// tear down after class
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testLess
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function testLessc()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php';
|
||||
|
||||
$lesscobj = new Lessc();
|
||||
|
||||
$cssfile = "
|
||||
a { font-size: 10px; }
|
||||
b .test {
|
||||
font-size: 10px;
|
||||
}
|
||||
";
|
||||
|
||||
try {
|
||||
$contentforlessc = ".bodywebsite {\n".$cssfile."\n}\n";
|
||||
//print '<pre>'.$contentforlessc.'</pre>';
|
||||
$result = $lesscobj->compile($contentforlessc);
|
||||
//var_dump($contentforlessc); exit;
|
||||
} catch (exception $e) {
|
||||
//echo "failed to compile lessc";
|
||||
dol_syslog("Failed to compile the CSS with lessc: ".$e->getMessage(), LOG_WARNING);
|
||||
}
|
||||
|
||||
$cssexpected = "
|
||||
.bodywebsite a {
|
||||
font-size: 10px;
|
||||
}
|
||||
.bodywebsite b .test {
|
||||
font-size: 10px;
|
||||
}
|
||||
";
|
||||
|
||||
print __METHOD__." SeparatorDecimal=".$result."\n";
|
||||
$this->assertEquals(trim($result), trim($cssexpected));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user