Merge branch 'develop' into stripetransac
This commit is contained in:
commit
c587de4a3d
@ -356,7 +356,7 @@ print '<tr class="oddeven">'."\n";
|
|||||||
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
||||||
print '<td align="center"> </td>'."\n";
|
print '<td align="center"> </td>'."\n";
|
||||||
print '<td align="right">'."\n";
|
print '<td align="right">'."\n";
|
||||||
$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
$tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -372,32 +372,32 @@ class Asset extends CommonObject
|
|||||||
if ($mode == 0 || $mode == 1)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled');
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
if ($status == 0) return $langs->trans('Disabled');
|
elseif ($status == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
elseif ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,11 +101,15 @@ else
|
|||||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||||
|
|
||||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
|
||||||
if ($action == 'default')
|
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
|
||||||
|
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=$defaultview;
|
||||||
|
if ($action == 'default') // When action is default, we want a calendar view and not the list
|
||||||
{
|
{
|
||||||
$action = ((! empty($conf->global->AGENDA_DEFAULT_VIEW) && $conf->global->AGENDA_DEFAULT_VIEW!='show_list') ? $conf->global->AGENDA_DEFAULT_VIEW : 'show_month');
|
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
|
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') {
|
||||||
$action='show_month'; $day='';
|
$action='show_month'; $day='';
|
||||||
} // View by month
|
} // View by month
|
||||||
|
|||||||
@ -3174,18 +3174,18 @@ class Propal extends CommonObject
|
|||||||
|
|
||||||
$statuttrans='';
|
$statuttrans='';
|
||||||
if ($statut==self::STATUS_DRAFT) $statuttrans='statut0';
|
if ($statut==self::STATUS_DRAFT) $statuttrans='statut0';
|
||||||
if ($statut==self::STATUS_VALIDATED) $statuttrans='statut1';
|
elseif ($statut==self::STATUS_VALIDATED) $statuttrans='statut1';
|
||||||
if ($statut==self::STATUS_SIGNED) $statuttrans='statut3';
|
elseif ($statut==self::STATUS_SIGNED) $statuttrans='statut3';
|
||||||
if ($statut==self::STATUS_NOTSIGNED) $statuttrans='statut5';
|
elseif ($statut==self::STATUS_NOTSIGNED) $statuttrans='statut5';
|
||||||
if ($statut==self::STATUS_BILLED) $statuttrans='statut6';
|
elseif ($statut==self::STATUS_BILLED) $statuttrans='statut6';
|
||||||
|
|
||||||
if ($mode == 0) return $this->labelstatut[$statut];
|
if ($mode == 0) return $this->labelstatut[$statut];
|
||||||
if ($mode == 1) return $this->labelstatut_short[$statut];
|
elseif ($mode == 1) return $this->labelstatut_short[$statut];
|
||||||
if ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut];
|
elseif ($mode == 2) return img_picto($this->labelstatut_short[$statut], $statuttrans).' '.$this->labelstatut_short[$statut];
|
||||||
if ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans);
|
elseif ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans);
|
||||||
if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut];
|
elseif ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut];
|
||||||
if ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
elseif ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||||
if ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
elseif ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -148,29 +148,29 @@ if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate";
|
|||||||
|
|
||||||
$checkedtypetiers=0;
|
$checkedtypetiers=0;
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'f.facnumber'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'f.facnumber'=>array('label'=>"Ref", 'checked'=>1),
|
||||||
'f.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
|
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
|
||||||
'f.type'=>array('label'=>$langs->trans("Type"), 'checked'=>0),
|
'f.type'=>array('label'=>"Type", 'checked'=>0),
|
||||||
'f.date'=>array('label'=>$langs->trans("DateInvoice"), 'checked'=>1),
|
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1),
|
||||||
'f.date_lim_reglement'=>array('label'=>$langs->trans("DateDue"), 'checked'=>1),
|
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1),
|
||||||
'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
|
||||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
|
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||||
'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||||
'f.fk_mode_reglement'=>array('label'=>$langs->trans("PaymentMode"), 'checked'=>1),
|
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1),
|
||||||
'f.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
|
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||||
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj=="1")),
|
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj=="1")),
|
||||||
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj=="1")),
|
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj=="1")),
|
||||||
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
|
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||||
'dynamount_payed'=>array('label'=>$langs->trans("Received"), 'checked'=>0),
|
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0),
|
||||||
'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0),
|
'rtp'=>array('label'=>"Rest", 'checked'=>0),
|
||||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
@ -422,22 +422,14 @@ if ($filtre)
|
|||||||
}
|
}
|
||||||
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
|
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
|
||||||
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
||||||
if ($search_type != '' && $search_type >= 0)
|
if ($search_type != '') $sql.=" AND f.type IN (".$db->escape($search_type).")";
|
||||||
{
|
|
||||||
if ($search_type == '0') $sql.=" AND f.type = 0"; // standard
|
|
||||||
if ($search_type == '1') $sql.=" AND f.type = 1"; // replacement
|
|
||||||
if ($search_type == '2') $sql.=" AND f.type = 2"; // credit note
|
|
||||||
if ($search_type == '3') $sql.=" AND f.type = 3"; // deposit
|
|
||||||
if ($search_type == '4') $sql.=" AND f.type = 4"; // proforma
|
|
||||||
if ($search_type == '5') $sql.=" AND f.type = 5"; // situation
|
|
||||||
}
|
|
||||||
if ($search_project) $sql .= natural_search('p.ref', $search_project);
|
if ($search_project) $sql .= natural_search('p.ref', $search_project);
|
||||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||||
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
if ($search_town) $sql.= natural_search('s.town', $search_town);
|
||||||
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
if ($search_zip) $sql.= natural_search("s.zip",$search_zip);
|
||||||
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
||||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
|
||||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
|
||||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||||
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
|
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
|
||||||
if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1);
|
if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1);
|
||||||
@ -1071,11 +1063,20 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['typent.code']['checked']))
|
if (! empty($arrayfields['typent.code']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
if (! is_array($typenArray) || count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||||
print $typenArray[$obj->typent_code];
|
print $typenArray[$obj->typent_code];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Staff
|
||||||
|
if (! empty($arrayfields['staff.code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
if (! is_array($staffArray) || count($staffArray)==0) $staffArray = $formcompany->effectif_array(1);
|
||||||
|
print $staffArray[$obj->staff_code];
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||||
|
|||||||
@ -135,15 +135,15 @@ class Cpaiement
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
|
|
||||||
if (!$notrigger) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// want this action to call a trigger.
|
||||||
// want this action to call a trigger.
|
//if (!$notrigger) {
|
||||||
|
|
||||||
//// Call triggers
|
// // Call triggers
|
||||||
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||||
//if ($result < 0) $error++;
|
// if ($result < 0) $error++;
|
||||||
//// End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -278,15 +278,15 @@ class Cpaiement
|
|||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// want this action calls a trigger.
|
||||||
// want this action calls a trigger.
|
//if (!$error && !$notrigger) {
|
||||||
|
|
||||||
//// Call triggers
|
// // Call triggers
|
||||||
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -316,17 +316,15 @@ class Cpaiement
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
if (!$notrigger) {
|
// want this action calls a trigger.
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
//if (!$error && !$notrigger) {
|
||||||
// want this action calls a trigger.
|
|
||||||
|
|
||||||
//// Call triggers
|
// // Call triggers
|
||||||
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
||||||
|
|||||||
@ -1108,8 +1108,8 @@ class Form
|
|||||||
else if (!is_array($selected)) $selected = array($selected);
|
else if (!is_array($selected)) $selected = array($selected);
|
||||||
|
|
||||||
// Clean $filter that may contains sql conditions so sql code
|
// Clean $filter that may contains sql conditions so sql code
|
||||||
if (function_exists('test_sql_and_script_inject')) {
|
if (function_exists('testSqlAndScriptInject')) {
|
||||||
if (test_sql_and_script_inject($filter, 3)>0) {
|
if (testSqlAndScriptInject($filter, 3)>0) {
|
||||||
$filter ='';
|
$filter ='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5730,7 +5730,7 @@ class Form
|
|||||||
* @param string $morecss Add more class to css styles
|
* @param string $morecss Add more class to css styles
|
||||||
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
||||||
* @param string $placeholder String to use as placeholder
|
* @param string $placeholder String to use as placeholder
|
||||||
* @param integer $acceptdelayedhtml 1 if caller request to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
|
* @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
|
||||||
* @return string HTML select string
|
* @return string HTML select string
|
||||||
* @see selectArrayFilter, ajax_combobox in ajax.lib.php
|
* @see selectArrayFilter, ajax_combobox in ajax.lib.php
|
||||||
*/
|
*/
|
||||||
@ -5832,7 +5832,7 @@ class Form
|
|||||||
* @param string $morecss Add more class to css styles
|
* @param string $morecss Add more class to css styles
|
||||||
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
||||||
* @param string $placeholder String to use as placeholder
|
* @param string $placeholder String to use as placeholder
|
||||||
* @param integer $acceptdelayedhtml 1 if caller request to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
|
* @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
|
||||||
* @return string HTML select string
|
* @return string HTML select string
|
||||||
* @see selectArrayAjax, ajax_combobox in ajax.lib.php
|
* @see selectArrayAjax, ajax_combobox in ajax.lib.php
|
||||||
*/
|
*/
|
||||||
@ -5949,55 +5949,76 @@ class Form
|
|||||||
* @param int $width Force width of select box. May be used only when using jquery couch. Example: 250, 95%
|
* @param int $width Force width of select box. May be used only when using jquery couch. Example: 250, 95%
|
||||||
* @param string $moreattrib Add more options on select component. Example: 'disabled'
|
* @param string $moreattrib Add more options on select component. Example: 'disabled'
|
||||||
* @param string $elemtype Type of element we show ('category', ...)
|
* @param string $elemtype Type of element we show ('category', ...)
|
||||||
|
* @param string $placeholder String to use as placeholder
|
||||||
|
* @param int $addjscombo Add js combo
|
||||||
* @return string HTML multiselect string
|
* @return string HTML multiselect string
|
||||||
* @see selectarray
|
* @see selectarray
|
||||||
*/
|
*/
|
||||||
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='',$elemtype='')
|
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=1)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
|
|
||||||
// Add code for jquery to use multiselect
|
// Add code for jquery to use multiselect
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||||
{
|
{
|
||||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
$out.="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||||
$out.="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
<script type="text/javascript">'."\n";
|
||||||
<script type="text/javascript">
|
if ($addjscombo == 1)
|
||||||
function formatResult(record) {'."\n";
|
{
|
||||||
if ($elemtype == 'category')
|
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||||
{
|
$out.= 'function formatResult(record) {'."\n";
|
||||||
$out.=' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\';
|
if ($elemtype == 'category')
|
||||||
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
|
{
|
||||||
}
|
$out.=' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\';
|
||||||
else
|
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
|
||||||
{
|
}
|
||||||
$out.='return record.text;';
|
else
|
||||||
}
|
{
|
||||||
$out.= ' };
|
$out.='return record.text;';
|
||||||
function formatSelection(record) {'."\n";
|
}
|
||||||
if ($elemtype == 'category')
|
$out.= '};'."\n";
|
||||||
{
|
$out.= 'function formatSelection(record) {'."\n";
|
||||||
$out.=' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\';
|
if ($elemtype == 'category')
|
||||||
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
|
{
|
||||||
}
|
$out.=' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\';
|
||||||
else
|
return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> \'+record.text+\'</span>\';';
|
||||||
{
|
}
|
||||||
$out.='return record.text;';
|
else
|
||||||
}
|
{
|
||||||
$out.= ' };
|
$out.='return record.text;';
|
||||||
$(document).ready(function () {
|
}
|
||||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
$out.= '};'."\n";
|
||||||
dir: \'ltr\',
|
$out.= '$(document).ready(function () {
|
||||||
// Specify format function for dropdown item
|
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||||
formatResult: formatResult,
|
dir: \'ltr\',
|
||||||
templateResult: formatResult, /* For 4.0 */
|
// Specify format function for dropdown item
|
||||||
// Specify format function for selected item
|
formatResult: formatResult,
|
||||||
formatSelection: formatSelection,
|
templateResult: formatResult, /* For 4.0 */
|
||||||
templateResult: formatSelection /* For 4.0 */
|
// Specify format function for selected item
|
||||||
});
|
formatSelection: formatSelection,
|
||||||
});
|
templateResult: formatSelection /* For 4.0 */
|
||||||
</script>';
|
});
|
||||||
|
});'."\n";
|
||||||
|
}
|
||||||
|
elseif ($addjscombo == 2)
|
||||||
|
{
|
||||||
|
// Add other js lib
|
||||||
|
// ...
|
||||||
|
$out.= '$(document).ready(function () {
|
||||||
|
$(\'#'.$htmlname.'\').multiSelect({
|
||||||
|
containerHTML: \'<div class="multi-select-container">\',
|
||||||
|
menuHTML: \'<div class="multi-select-menu">\',
|
||||||
|
buttonHTML: \'<span class="multi-select-button '.$morecss.'">\',
|
||||||
|
menuItemHTML: \'<label class="multi-select-menuitem">\',
|
||||||
|
activeClass: \'multi-select-container--open\',
|
||||||
|
noneText: \''.$placeholder.'\'
|
||||||
|
});
|
||||||
|
})';
|
||||||
|
}
|
||||||
|
$out.= '</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try also magic suggest
|
// Try also magic suggest
|
||||||
|
|||||||
@ -123,26 +123,29 @@ if ($disablenofollow) echo '</a>';
|
|||||||
|
|
||||||
<div id="login_right">
|
<div id="login_right">
|
||||||
|
|
||||||
<table class="left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
|
<div class="tagtable left centpercent" title="<?php echo $langs->trans("EnterLoginDetail"); ?>">
|
||||||
|
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<tr>
|
<div class="trinputlogin">
|
||||||
<td class="nowrap center valignmiddle">
|
<div class="tagtd nowrap center valignmiddle tdinputlogin">
|
||||||
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php } ?>
|
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="username" class="hidden"><?php echo $langs->trans("Login"); ?></label><?php } ?>
|
||||||
<!-- <span class="span-icon-user">-->
|
<!-- <span class="span-icon-user">-->
|
||||||
<span class="fa fa-user">
|
<span class="fa fa-user">
|
||||||
<input type="text" id="username" placeholder="<?php echo $langs->trans("Login"); ?>" name="username" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" autofocus="autofocus" />
|
|
||||||
</span>
|
</span>
|
||||||
</td>
|
<input type="text" id="username" placeholder="<?php echo $langs->trans("Login"); ?>" name="username" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" autofocus="autofocus" />
|
||||||
</tr>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Password -->
|
<!-- Password -->
|
||||||
<tr>
|
<div class="trinputlogin">
|
||||||
<td class="nowrap center valignmiddle">
|
<div class="tagtd nowrap center valignmiddle tdinputlogin">
|
||||||
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php } ?>
|
<?php if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?><label for="password" class="hidden"><?php echo $langs->trans("Password"); ?></label><?php } ?>
|
||||||
<!--<span class="span-icon-password">-->
|
<!--<span class="span-icon-password">-->
|
||||||
<span class="fa fa-key">
|
<span class="fa fa-key">
|
||||||
<input id="password" placeholder="<?php echo $langs->trans("Password"); ?>" name="password" class="flat input-icon-password minwidth150" type="password" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" autocomplete="<?php echo empty($conf->global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE)?'off':'on'; ?>" />
|
|
||||||
</span>
|
</span>
|
||||||
</td></tr>
|
<input id="password" placeholder="<?php echo $langs->trans("Password"); ?>" name="password" class="flat input-icon-password minwidth150" type="password" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" autocomplete="<?php echo empty($conf->global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE)?'off':'on'; ?>" />
|
||||||
|
</div></div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (! empty($morelogincontent)) {
|
if (! empty($morelogincontent)) {
|
||||||
if (is_array($morelogincontent)) {
|
if (is_array($morelogincontent)) {
|
||||||
@ -168,10 +171,11 @@ if ($captcha) {
|
|||||||
// TODO: provide accessible captcha variants
|
// TODO: provide accessible captcha variants
|
||||||
?>
|
?>
|
||||||
<!-- Captcha -->
|
<!-- Captcha -->
|
||||||
<tr>
|
<div class="trinputlogin">
|
||||||
<td class="nowrap none center">
|
<div class="tagtd nowrap none center valignmiddle tdinputlogin">
|
||||||
|
|
||||||
<table class="login_table_securitycode centpercent"><tr>
|
<table class="login_table_securitycode centpercent">
|
||||||
|
<tr class="valignmiddle">
|
||||||
<td>
|
<td>
|
||||||
<span class="span-icon-security">
|
<span class="span-icon-security">
|
||||||
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width100" type="text" maxlength="5" name="code" tabindex="3" />
|
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width100" type="text" maxlength="5" name="code" tabindex="3" />
|
||||||
@ -179,11 +183,13 @@ if ($captcha) {
|
|||||||
</td>
|
</td>
|
||||||
<td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" /></td>
|
<td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" /></td>
|
||||||
<td><a href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a></td>
|
<td><a href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a></td>
|
||||||
</tr></table>
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
</td></tr>
|
</div></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div> <!-- end div login-right -->
|
</div> <!-- end div login-right -->
|
||||||
|
|
||||||
|
|||||||
@ -97,17 +97,17 @@ if ($disablenofollow) echo '</a>';
|
|||||||
|
|
||||||
<div id="login_right">
|
<div id="login_right">
|
||||||
|
|
||||||
<table summary="Login pass" class="centpercent">
|
<div class="tagtable centpercent" title="Login pass" >
|
||||||
|
|
||||||
<!-- Login -->
|
<!-- Login -->
|
||||||
<tr>
|
<div class="trinputlogin">
|
||||||
<td valign="bottom" class="nowrap center">
|
<div class="tagtd center valignmiddle tdinputlogin">
|
||||||
<!-- <span class="span-icon-user">-->
|
<!-- <span class="span-icon-user">-->
|
||||||
<span class="fa fa-user">
|
<span class="fa fa-user">
|
||||||
<input type="text" placeholder="<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?> id="username" name="username" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($username); ?>" tabindex="1" />
|
<input type="text" placeholder="<?php echo $langs->trans("Login"); ?>" <?php echo $disabled; ?> id="username" name="username" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($username); ?>" tabindex="1" />
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (! empty($morelogincontent)) {
|
if (! empty($morelogincontent)) {
|
||||||
@ -134,10 +134,11 @@ if (! empty($morelogincontent)) {
|
|||||||
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
||||||
?>
|
?>
|
||||||
<!-- Captcha -->
|
<!-- Captcha -->
|
||||||
<tr>
|
<div class="trinputlogin">
|
||||||
<td class="tdtop nowrap none center">
|
<div class="tdinputlogin nowrap none center valignmiddle tdinputlogin">
|
||||||
|
|
||||||
<table class="login_table_securitycode centpercent"><tr class="valignmiddle">
|
<table class="login_table_securitycode centpercent">
|
||||||
|
<tr class="valignmiddle">
|
||||||
<td>
|
<td>
|
||||||
<!-- <span class="span-icon-security"> -->
|
<!-- <span class="span-icon-security"> -->
|
||||||
<span class="nofa">
|
<span class="nofa">
|
||||||
@ -148,7 +149,7 @@ if (! empty($morelogincontent)) {
|
|||||||
<td><a href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a></td>
|
<td><a href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
|
||||||
</td></tr>
|
</div></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class Don extends CommonObject
|
|||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (empty($this->labelstatut) || empty($this->labelstatushort))
|
if (empty($this->labelstatut) || empty($this->labelstatutshort))
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
@ -132,37 +132,37 @@ class Don extends CommonObject
|
|||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatutshort[$statut];
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatutshort[$statut];
|
elseif ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatutshort[$statut];
|
elseif ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatutshort[$statut];
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatutshort[$statut];
|
elseif ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatutshort[$statut];
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5');
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5');
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0');
|
elseif ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0');
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1');
|
elseif ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1');
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6');
|
elseif ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatut[$statut];
|
if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
elseif ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
elseif ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
|
||||||
if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
elseif ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut5');
|
if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut5');
|
||||||
if ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
elseif ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
||||||
if ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
elseif ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||||
if ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
elseif ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut5');
|
if ($statut == -1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut5');
|
||||||
if ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
elseif ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut0');
|
||||||
if ($statut == 1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
elseif ($statut == 1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
|
||||||
if ($statut == 2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
elseif ($statut == 2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
Copyright (c) 2009 Michael Aufreiter, http://www.quasipartikel.at
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
/* Multiselect
|
|
||||||
----------------------------------*/
|
|
||||||
.multiselect {
|
|
||||||
width: 600px;
|
|
||||||
height: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect {
|
|
||||||
border: solid 1px;
|
|
||||||
font-size: 0.8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect ul {
|
|
||||||
-moz-user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect li {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
cursor: default;
|
|
||||||
line-height: 20px;
|
|
||||||
height: 20px;
|
|
||||||
font-size: 11px;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect li a {
|
|
||||||
color: #999;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 0;
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect li.ui-draggable-dragging {
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect div.selected {
|
|
||||||
position: relative;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect ul.selected {
|
|
||||||
position: relative;
|
|
||||||
padding: 0;
|
|
||||||
overflow: auto;
|
|
||||||
overflow-x: hidden;
|
|
||||||
background: #fff;
|
|
||||||
margin: 0;
|
|
||||||
list-style: none;
|
|
||||||
border: 0;
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect ul.selected li {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect div.available {
|
|
||||||
position: relative;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
float: left;
|
|
||||||
border-left: 1px solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect ul.available {
|
|
||||||
position: relative;
|
|
||||||
padding: 0;
|
|
||||||
overflow: auto;
|
|
||||||
overflow-x: hidden;
|
|
||||||
background: #fff;
|
|
||||||
margin: 0;
|
|
||||||
list-style: none;
|
|
||||||
border: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect ul.available li {
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .ui-state-default {
|
|
||||||
border: none;
|
|
||||||
margin-bottom: 1px;
|
|
||||||
position: relative;
|
|
||||||
padding-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .ui-state-hover {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .ui-widget-header {
|
|
||||||
border: none;
|
|
||||||
font-size: 11px;
|
|
||||||
margin-bottom: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .add-all {
|
|
||||||
float: right;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .remove-all {
|
|
||||||
float: right;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .search {
|
|
||||||
float: left;
|
|
||||||
padding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect .count {
|
|
||||||
float: left;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect li span.ui-icon-arrowthick-2-n-s {
|
|
||||||
position: absolute;
|
|
||||||
left: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect li a.action {
|
|
||||||
position: absolute;
|
|
||||||
right: 2px;
|
|
||||||
top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-multiselect input.search {
|
|
||||||
height: 14px;
|
|
||||||
padding: 1px;
|
|
||||||
opacity: 0.5;
|
|
||||||
margin: 4px;
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
@ -0,0 +1,360 @@
|
|||||||
|
// jquery.multi-select.js
|
||||||
|
// by mySociety
|
||||||
|
// https://github.com/mysociety/jquery-multi-select
|
||||||
|
|
||||||
|
;(function($) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var pluginName = "multiSelect",
|
||||||
|
defaults = {
|
||||||
|
'containerHTML': '<div class="multi-select-container">',
|
||||||
|
'menuHTML': '<div class="multi-select-menu">',
|
||||||
|
'buttonHTML': '<span class="multi-select-button">',
|
||||||
|
'menuItemsHTML': '<div class="multi-select-menuitems">',
|
||||||
|
'menuItemHTML': '<label class="multi-select-menuitem">',
|
||||||
|
'presetsHTML': '<div class="multi-select-presets">',
|
||||||
|
'activeClass': 'multi-select-container--open',
|
||||||
|
'noneText': '-- Select --',
|
||||||
|
'allText': undefined,
|
||||||
|
'presets': undefined,
|
||||||
|
'positionedMenuClass': 'multi-select-container--positioned',
|
||||||
|
'positionMenuWithin': undefined,
|
||||||
|
'viewportBottomGutter': 20,
|
||||||
|
'menuMinHeight': 200
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function MultiSelect(element, options) {
|
||||||
|
this.element = element;
|
||||||
|
this.$element = $(element);
|
||||||
|
this.settings = $.extend( {}, defaults, options );
|
||||||
|
this._defaults = defaults;
|
||||||
|
this._name = pluginName;
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
function arraysAreEqual(array1, array2) {
|
||||||
|
if ( array1.length != array2.length ){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
array1.sort();
|
||||||
|
array2.sort();
|
||||||
|
|
||||||
|
for ( var i = 0; i < array1.length; i++ ){
|
||||||
|
if ( array1[i] !== array2[i] ){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.extend(MultiSelect.prototype, {
|
||||||
|
|
||||||
|
init: function() {
|
||||||
|
this.checkSuitableInput();
|
||||||
|
this.findLabels();
|
||||||
|
this.constructContainer();
|
||||||
|
this.constructButton();
|
||||||
|
this.constructMenu();
|
||||||
|
|
||||||
|
this.setUpBodyClickListener();
|
||||||
|
this.setUpLabelsClickListener();
|
||||||
|
|
||||||
|
this.$element.hide();
|
||||||
|
},
|
||||||
|
|
||||||
|
checkSuitableInput: function(text) {
|
||||||
|
if ( this.$element.is('select[multiple]') === false ) {
|
||||||
|
throw new Error('$.multiSelect only works on <select multiple> elements');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
findLabels: function() {
|
||||||
|
this.$labels = $('label[for="' + this.$element.attr('id') + '"]');
|
||||||
|
},
|
||||||
|
|
||||||
|
constructContainer: function() {
|
||||||
|
this.$container = $(this.settings['containerHTML']);
|
||||||
|
this.$element.data('multi-select-container', this.$container);
|
||||||
|
this.$container.insertAfter(this.$element);
|
||||||
|
},
|
||||||
|
|
||||||
|
constructButton: function() {
|
||||||
|
var _this = this;
|
||||||
|
this.$button = $(this.settings['buttonHTML']);
|
||||||
|
this.$button.attr({
|
||||||
|
'role': 'button',
|
||||||
|
'aria-haspopup': 'true',
|
||||||
|
'tabindex': 0,
|
||||||
|
'aria-label': this.$labels.eq(0).text()
|
||||||
|
})
|
||||||
|
.on('keydown.multiselect', function(e) {
|
||||||
|
var key = e.which;
|
||||||
|
var returnKey = 13;
|
||||||
|
var spaceKey = 32;
|
||||||
|
if ((key === returnKey) || (key === spaceKey)) {
|
||||||
|
_this.$button.click();
|
||||||
|
}
|
||||||
|
}).on('click.multiselect', function(e) {
|
||||||
|
_this.menuToggle();
|
||||||
|
})
|
||||||
|
.appendTo(this.$container);
|
||||||
|
|
||||||
|
this.$element.on('change.multiselect', function() {
|
||||||
|
_this.updateButtonContents();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.updateButtonContents();
|
||||||
|
},
|
||||||
|
|
||||||
|
updateButtonContents: function() {
|
||||||
|
var _this = this;
|
||||||
|
var options = [];
|
||||||
|
var selected = [];
|
||||||
|
|
||||||
|
this.$element.children('option').each(function() {
|
||||||
|
var text = /** @type string */ ($(this).text());
|
||||||
|
options.push(text);
|
||||||
|
if ($(this).is(':selected')) {
|
||||||
|
selected.push( $.trim(text) );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$button.empty();
|
||||||
|
|
||||||
|
if (selected.length == 0) {
|
||||||
|
this.$button.text( this.settings['noneText'] );
|
||||||
|
} else if ( (selected.length === options.length) && this.settings['allText']) {
|
||||||
|
this.$button.text( this.settings['allText'] );
|
||||||
|
} else {
|
||||||
|
this.$button.text( selected.join(', ') );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
constructMenu: function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$menu = $(this.settings['menuHTML']);
|
||||||
|
this.$menu.attr({
|
||||||
|
'role': 'menu'
|
||||||
|
}).on('keyup.multiselect', function(e){
|
||||||
|
var key = e.which;
|
||||||
|
var escapeKey = 27;
|
||||||
|
if (key === escapeKey) {
|
||||||
|
_this.menuHide();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.appendTo(this.$container);
|
||||||
|
|
||||||
|
this.constructMenuItems();
|
||||||
|
|
||||||
|
if ( this.settings['presets'] ) {
|
||||||
|
this.constructPresets();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
constructMenuItems: function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
this.$menuItems = $(this.settings['menuItemsHTML']);
|
||||||
|
this.$menu.append(this.$menuItems);
|
||||||
|
|
||||||
|
this.$element.on('change.multiselect', function(e, internal) {
|
||||||
|
// Don't need to update the menu items if this
|
||||||
|
// change event was fired by our tickbox handler.
|
||||||
|
if(internal !== true){
|
||||||
|
_this.updateMenuItems();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.updateMenuItems();
|
||||||
|
},
|
||||||
|
|
||||||
|
updateMenuItems: function() {
|
||||||
|
var _this = this;
|
||||||
|
this.$menuItems.empty();
|
||||||
|
|
||||||
|
this.$element.children('option').each(function(option_index, option) {
|
||||||
|
var $item = _this.constructMenuItem($(option), option_index);
|
||||||
|
_this.$menuItems.append($item);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
constructPresets: function() {
|
||||||
|
var _this = this;
|
||||||
|
this.$presets = $(this.settings['presetsHTML']);
|
||||||
|
this.$menu.prepend(this.$presets);
|
||||||
|
|
||||||
|
$.each(this.settings['presets'], function(i, preset){
|
||||||
|
var unique_id = _this.$element.attr('name') + '_preset_' + i;
|
||||||
|
var $item = $(_this.settings['menuItemHTML'])
|
||||||
|
.attr({
|
||||||
|
'for': unique_id,
|
||||||
|
'role': 'menuitem'
|
||||||
|
})
|
||||||
|
.text(' ' + preset.name)
|
||||||
|
.appendTo(_this.$presets);
|
||||||
|
|
||||||
|
var $input = $('<input>')
|
||||||
|
.attr({
|
||||||
|
'type': 'radio',
|
||||||
|
'name': _this.$element.attr('name') + '_presets',
|
||||||
|
'id': unique_id
|
||||||
|
})
|
||||||
|
.prependTo($item);
|
||||||
|
|
||||||
|
$input.on('change.multiselect', function(){
|
||||||
|
_this.$element.val(preset.options);
|
||||||
|
_this.$element.trigger('change');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$element.on('change.multiselect', function() {
|
||||||
|
_this.updatePresets();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.updatePresets();
|
||||||
|
},
|
||||||
|
|
||||||
|
updatePresets: function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
$.each(this.settings['presets'], function(i, preset){
|
||||||
|
var unique_id = _this.$element.attr('name') + '_preset_' + i;
|
||||||
|
var $input = _this.$presets.find('#' + unique_id);
|
||||||
|
|
||||||
|
if ( arraysAreEqual(preset.options || [], _this.$element.val() || []) ){
|
||||||
|
$input.prop('checked', true);
|
||||||
|
} else {
|
||||||
|
$input.prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
constructMenuItem: function($option, option_index) {
|
||||||
|
var unique_id = this.$element.attr('name') + '_' + option_index;
|
||||||
|
var $item = $(this.settings['menuItemHTML'])
|
||||||
|
.attr({
|
||||||
|
'for': unique_id,
|
||||||
|
'role': 'menuitem'
|
||||||
|
})
|
||||||
|
.text(' ' + $option.text());
|
||||||
|
|
||||||
|
var $input = $('<input>')
|
||||||
|
.attr({
|
||||||
|
'type': 'checkbox',
|
||||||
|
'id': unique_id,
|
||||||
|
'value': $option.val()
|
||||||
|
})
|
||||||
|
.prependTo($item);
|
||||||
|
|
||||||
|
if ( $option.is(':disabled') ) {
|
||||||
|
$input.attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
|
if ( $option.is(':selected') ) {
|
||||||
|
$input.prop('checked', 'checked');
|
||||||
|
}
|
||||||
|
|
||||||
|
$input.on('change.multiselect', function() {
|
||||||
|
if ($(this).prop('checked')) {
|
||||||
|
$option.prop('selected', true);
|
||||||
|
} else {
|
||||||
|
$option.prop('selected', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// .prop() on its own doesn't generate a change event.
|
||||||
|
// Other plugins might want to do stuff onChange.
|
||||||
|
$option.trigger('change', [true]);
|
||||||
|
});
|
||||||
|
|
||||||
|
return $item;
|
||||||
|
},
|
||||||
|
|
||||||
|
setUpBodyClickListener: function() {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
|
// Hide the $menu when you click outside of it.
|
||||||
|
$('html').on('click.multiselect', function(){
|
||||||
|
_this.menuHide();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Stop click events from inside the $button or $menu from
|
||||||
|
// bubbling up to the body and closing the menu!
|
||||||
|
this.$container.on('click.multiselect', function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setUpLabelsClickListener: function() {
|
||||||
|
var _this = this;
|
||||||
|
this.$labels.on('click.multiselect', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
_this.menuToggle();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
menuShow: function() {
|
||||||
|
$('html').trigger('click.multiselect'); // Close any other open menus
|
||||||
|
this.$container.addClass(this.settings['activeClass']);
|
||||||
|
|
||||||
|
if ( this.settings['positionMenuWithin'] && this.settings['positionMenuWithin'] instanceof $ ) {
|
||||||
|
var menuLeftEdge = this.$menu.offset().left + this.$menu.outerWidth();
|
||||||
|
var withinLeftEdge = this.settings['positionMenuWithin'].offset().left +
|
||||||
|
this.settings['positionMenuWithin'].outerWidth();
|
||||||
|
|
||||||
|
if ( menuLeftEdge > withinLeftEdge ) {
|
||||||
|
this.$menu.css( 'width', (withinLeftEdge - this.$menu.offset().left) );
|
||||||
|
this.$container.addClass(this.settings['positionedMenuClass']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var menuBottom = this.$menu.offset().top + this.$menu.outerHeight();
|
||||||
|
var viewportBottom = $(window).scrollTop() + $(window).height();
|
||||||
|
if ( menuBottom > viewportBottom - this.settings['viewportBottomGutter'] ) {
|
||||||
|
this.$menu.css({
|
||||||
|
'maxHeight': Math.max(
|
||||||
|
viewportBottom - this.settings['viewportBottomGutter'] - this.$menu.offset().top,
|
||||||
|
this.settings['menuMinHeight']
|
||||||
|
),
|
||||||
|
'overflow': 'scroll'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$menu.css({
|
||||||
|
'maxHeight': '',
|
||||||
|
'overflow': ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
menuHide: function() {
|
||||||
|
this.$container.removeClass(this.settings['activeClass']);
|
||||||
|
this.$container.removeClass(this.settings['positionedMenuClass']);
|
||||||
|
this.$menu.css('width', 'auto');
|
||||||
|
},
|
||||||
|
|
||||||
|
menuToggle: function() {
|
||||||
|
if ( this.$container.hasClass(this.settings['activeClass']) ) {
|
||||||
|
this.menuHide();
|
||||||
|
} else {
|
||||||
|
this.menuShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$.fn[ pluginName ] = function(options) {
|
||||||
|
return this.each(function() {
|
||||||
|
if ( !$.data(this, "plugin_" + pluginName) ) {
|
||||||
|
$.data(this, "plugin_" + pluginName,
|
||||||
|
new MultiSelect(this, options) );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
9
htdocs/includes/jquery/plugins/multiselect/jquery.multi-select.min.js
vendored
Normal file
9
htdocs/includes/jquery/plugins/multiselect/jquery.multi-select.min.js
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
(function(c){function f(b,a){this.b=c(b);this.a=c.extend({},g,a);this.H()}var g={containerHTML:'<div class="multi-select-container">',menuHTML:'<div class="multi-select-menu">',buttonHTML:'<span class="multi-select-button">',menuItemsHTML:'<div class="multi-select-menuitems">',menuItemHTML:'<label class="multi-select-menuitem">',presetsHTML:'<div class="multi-select-presets">',activeClass:"multi-select-container--open",noneText:"-- Select --",allText:void 0,presets:void 0,positionedMenuClass:"multi-select-container--positioned",
|
||||||
|
positionMenuWithin:void 0,viewportBottomGutter:20,menuMinHeight:200};c.extend(f.prototype,{H:function(){this.v();this.G();this.A();this.w();this.B();this.J();this.K();this.b.hide()},v:function(){if(!1===this.b.is("select[multiple]"))throw Error("$.multiSelect only works on <select multiple> elements");},G:function(){this.l=c('label[for="'+this.b.attr("id")+'"]')},A:function(){this.f=c(this.a.containerHTML);this.b.data("multi-select-container",this.f);this.f.insertAfter(this.b)},w:function(){var b=
|
||||||
|
this;this.g=c(this.a.buttonHTML);this.g.attr({role:"button","aria-haspopup":"true",tabindex:0,"aria-label":this.l.eq(0).text()}).on("keydown.multiselect",function(a){a=a.which;13!==a&&32!==a||b.g.click()}).on("click.multiselect",function(){b.m()}).appendTo(this.f);this.b.on("change.multiselect",function(){b.o()});this.o()},o:function(){var b=[],a=[];this.b.children("option").each(function(){var d=c(this).text();b.push(d);c(this).is(":selected")&&a.push(c.trim(d))});this.g.empty();0==a.length?this.g.text(this.a.noneText):
|
||||||
|
a.length===b.length&&this.a.allText?this.g.text(this.a.allText):this.g.text(a.join(", "))},B:function(){var b=this;this.c=c(this.a.menuHTML);this.c.attr({role:"menu"}).on("keyup.multiselect",function(a){27===a.which&&b.j()}).appendTo(this.f);this.D();this.a.presets&&this.F()},D:function(){var b=this;this.h=c(this.a.menuItemsHTML);this.c.append(this.h);this.b.on("change.multiselect",function(a,c){!0!==c&&b.s()});this.s()},s:function(){var b=this;this.h.empty();this.b.children("option").each(function(a,
|
||||||
|
d){a=b.C(c(d),a);b.h.append(a)})},F:function(){var b=this;this.i=c(this.a.presetsHTML);this.c.prepend(this.i);c.each(this.a.presets,function(a,d){a=b.b.attr("name")+"_preset_"+a;var h=c(b.a.menuItemHTML).attr({"for":a,role:"menuitem"}).text(" "+d.name).appendTo(b.i);c("<input>").attr({type:"radio",name:b.b.attr("name")+"_presets",id:a}).prependTo(h).on("change.multiselect",function(){b.b.val(d.options);b.b.trigger("change")})});this.b.on("change.multiselect",function(){b.u()});this.u()},u:function(){var b=
|
||||||
|
this;c.each(this.a.presets,function(a,c){a=b.b.attr("name")+"_preset_"+a;a=b.i.find("#"+a);a:{c=c.options||[];var d=b.b.val()||[];if(c.length!=d.length)c=!1;else{c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!==d[e]){c=!1;break a}c=!0}}c?a.prop("checked",!0):a.prop("checked",!1)})},C:function(b,a){var d=this.b.attr("name")+"_"+a;a=c(this.a.menuItemHTML).attr({"for":d,role:"menuitem"}).text(" "+b.text());d=c("<input>").attr({type:"checkbox",id:d,value:b.val()}).prependTo(a);b.is(":disabled")&&
|
||||||
|
d.attr("disabled","disabled");b.is(":selected")&&d.prop("checked","checked");d.on("change.multiselect",function(){c(this).prop("checked")?b.prop("selected",!0):b.prop("selected",!1);b.trigger("change",[!0])});return a},J:function(){var b=this;c("html").on("click.multiselect",function(){b.j()});this.f.on("click.multiselect",function(a){a.stopPropagation()})},K:function(){var b=this;this.l.on("click.multiselect",function(a){a.preventDefault();a.stopPropagation();b.m()})},I:function(){c("html").trigger("click.multiselect");
|
||||||
|
this.f.addClass(this.a.activeClass);if(this.a.positionMenuWithin&&this.a.positionMenuWithin instanceof c){var b=this.c.offset().left+this.c.outerWidth(),a=this.a.positionMenuWithin.offset().left+this.a.positionMenuWithin.outerWidth();b>a&&(this.c.css("width",a-this.c.offset().left),this.f.addClass(this.a.positionedMenuClass))}b=this.c.offset().top+this.c.outerHeight();a=c(window).scrollTop()+c(window).height();b>a-this.a.viewportBottomGutter?this.c.css({maxHeight:Math.max(a-this.a.viewportBottomGutter-
|
||||||
|
this.c.offset().top,this.a.menuMinHeight),overflow:"scroll"}):this.c.css({maxHeight:"",overflow:""})},j:function(){this.f.removeClass(this.a.activeClass);this.f.removeClass(this.a.positionedMenuClass);this.c.css("width","auto")},m:function(){this.f.hasClass(this.a.activeClass)?this.j():this.I()}});c.fn.multiSelect=function(b){return this.each(function(){c.data(this,"plugin_multiSelect")||c.data(this,"plugin_multiSelect",new f(this,b))})}})(jQuery);
|
||||||
@ -1,336 +0,0 @@
|
|||||||
/*
|
|
||||||
* jQuery UI Multiselect
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Michael Aufreiter (quasipartikel.at)
|
|
||||||
* Yanick Rochon (yanick.rochon[at]gmail[dot]com)
|
|
||||||
*
|
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
|
||||||
* and GPL (GPL-LICENSE.txt) licenses.
|
|
||||||
*
|
|
||||||
* http://www.quasipartikel.at/multiselect/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Depends:
|
|
||||||
* ui.core.js
|
|
||||||
* ui.sortable.js
|
|
||||||
*
|
|
||||||
* Optional:
|
|
||||||
* localization (http://plugins.jquery.com/project/localisation)
|
|
||||||
* scrollTo (http://plugins.jquery.com/project/ScrollTo)
|
|
||||||
*
|
|
||||||
* Todo:
|
|
||||||
* Make batch actions faster
|
|
||||||
* Implement dynamic insertion through remote calls
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
|
|
||||||
$.widget("ui.multiselect", {
|
|
||||||
options: {
|
|
||||||
sortable: true,
|
|
||||||
searchable: true,
|
|
||||||
doubleClickable: true,
|
|
||||||
animated: 'fast',
|
|
||||||
show: 'slideDown',
|
|
||||||
hide: 'slideUp',
|
|
||||||
dividerLocation: 0.6,
|
|
||||||
nodeComparator: function(node1,node2) {
|
|
||||||
var text1 = node1.text(),
|
|
||||||
text2 = node2.text();
|
|
||||||
return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_create: function() {
|
|
||||||
this.element.hide();
|
|
||||||
this.id = this.element.attr("id");
|
|
||||||
this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
|
|
||||||
this.count = 0; // number of currently selected options
|
|
||||||
this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
|
|
||||||
this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
|
|
||||||
this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
|
|
||||||
this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
|
|
||||||
this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
|
|
||||||
this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
|
|
||||||
|
|
||||||
var that = this;
|
|
||||||
|
|
||||||
// set dimensions
|
|
||||||
this.container.width(this.element.width()+1);
|
|
||||||
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
|
|
||||||
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
|
|
||||||
|
|
||||||
// fix list height to match <option> depending on their individual header's heights
|
|
||||||
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
|
|
||||||
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
|
|
||||||
|
|
||||||
if ( !this.options.animated ) {
|
|
||||||
this.options.show = 'show';
|
|
||||||
this.options.hide = 'hide';
|
|
||||||
}
|
|
||||||
|
|
||||||
// init lists
|
|
||||||
this._populateLists(this.element.find('option'));
|
|
||||||
|
|
||||||
// make selection sortable
|
|
||||||
if (this.options.sortable) {
|
|
||||||
this.selectedList.sortable({
|
|
||||||
placeholder: 'ui-state-highlight',
|
|
||||||
axis: 'y',
|
|
||||||
update: function(event, ui) {
|
|
||||||
// apply the new sort order to the original selectbox
|
|
||||||
that.selectedList.find('li').each(function() {
|
|
||||||
if ($(this).data('optionLink'))
|
|
||||||
$(this).data('optionLink').remove().appendTo(that.element);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
receive: function(event, ui) {
|
|
||||||
ui.item.data('optionLink').attr('selected', true);
|
|
||||||
// increment count
|
|
||||||
that.count += 1;
|
|
||||||
that._updateCount();
|
|
||||||
// workaround, because there's no way to reference
|
|
||||||
// the new element, see http://dev.jqueryui.com/ticket/4303
|
|
||||||
that.selectedList.children('.ui-draggable').each(function() {
|
|
||||||
$(this).removeClass('ui-draggable');
|
|
||||||
$(this).data('optionLink', ui.item.data('optionLink'));
|
|
||||||
$(this).data('idx', ui.item.data('idx'));
|
|
||||||
that._applyItemState($(this), true);
|
|
||||||
});
|
|
||||||
|
|
||||||
// workaround according to http://dev.jqueryui.com/ticket/4088
|
|
||||||
setTimeout(function() { ui.item.remove(); }, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up livesearch
|
|
||||||
if (this.options.searchable) {
|
|
||||||
this._registerSearchEvents(this.availableContainer.find('input.search'));
|
|
||||||
} else {
|
|
||||||
$('.search').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// batch actions
|
|
||||||
this.container.find(".remove-all").click(function() {
|
|
||||||
that._populateLists(that.element.find('option').removeAttr('selected'));
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.container.find(".add-all").click(function() {
|
|
||||||
var options = that.element.find('option').not(":selected");
|
|
||||||
if (that.availableList.children('li:hidden').length > 1) {
|
|
||||||
that.availableList.children('li').each(function(i) {
|
|
||||||
if ($(this).is(":visible")) $(options[i-1]).attr('selected', 'selected');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
options.attr('selected', 'selected');
|
|
||||||
}
|
|
||||||
that._populateLists(that.element.find('option'));
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
destroy: function() {
|
|
||||||
this.element.show();
|
|
||||||
this.container.remove();
|
|
||||||
|
|
||||||
$.Widget.prototype.destroy.apply(this, arguments);
|
|
||||||
},
|
|
||||||
_populateLists: function(options) {
|
|
||||||
this.selectedList.children('.ui-element').remove();
|
|
||||||
this.availableList.children('.ui-element').remove();
|
|
||||||
this.count = 0;
|
|
||||||
|
|
||||||
var that = this;
|
|
||||||
var items = $(options.map(function(i) {
|
|
||||||
var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
|
|
||||||
|
|
||||||
if (this.selected) that.count += 1;
|
|
||||||
that._applyItemState(item, this.selected);
|
|
||||||
item.data('idx', i);
|
|
||||||
return item[0];
|
|
||||||
}));
|
|
||||||
|
|
||||||
// update count
|
|
||||||
this._updateCount();
|
|
||||||
that._filter.apply(this.availableContainer.find('input.search'), [that.availableList]);
|
|
||||||
},
|
|
||||||
_updateCount: function() {
|
|
||||||
this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
|
|
||||||
},
|
|
||||||
_getOptionNode: function(option) {
|
|
||||||
option = $(option);
|
|
||||||
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
|
|
||||||
node.data('optionLink', option);
|
|
||||||
return node;
|
|
||||||
},
|
|
||||||
// clones an item with associated data
|
|
||||||
// didn't find a smarter away around this
|
|
||||||
_cloneWithData: function(clonee) {
|
|
||||||
var clone = clonee.clone(false,false);
|
|
||||||
clone.data('optionLink', clonee.data('optionLink'));
|
|
||||||
clone.data('idx', clonee.data('idx'));
|
|
||||||
return clone;
|
|
||||||
},
|
|
||||||
_setSelected: function(item, selected) {
|
|
||||||
item.data('optionLink').attr('selected', selected);
|
|
||||||
|
|
||||||
if (selected) {
|
|
||||||
var selectedItem = this._cloneWithData(item);
|
|
||||||
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
|
|
||||||
selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
|
|
||||||
|
|
||||||
this._applyItemState(selectedItem, true);
|
|
||||||
return selectedItem;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// look for successor based on initial option index
|
|
||||||
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
|
|
||||||
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
|
|
||||||
|
|
||||||
// TODO: test needed for dynamic list populating
|
|
||||||
if ( direction ) {
|
|
||||||
while (i>=0 && i<items.length) {
|
|
||||||
direction > 0 ? i++ : i--;
|
|
||||||
if ( direction != comparator(item, $(items[i])) ) {
|
|
||||||
// going up, go back one item down, otherwise leave as is
|
|
||||||
succ = items[direction > 0 ? i : i+1];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
succ = items[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
var availableItem = this._cloneWithData(item);
|
|
||||||
succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
|
|
||||||
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
|
|
||||||
availableItem.hide()[this.options.show](this.options.animated);
|
|
||||||
|
|
||||||
this._applyItemState(availableItem, false);
|
|
||||||
return availableItem;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_applyItemState: function(item, selected) {
|
|
||||||
if (selected) {
|
|
||||||
if (this.options.sortable)
|
|
||||||
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
|
|
||||||
else
|
|
||||||
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
|
|
||||||
item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
|
|
||||||
this._registerRemoveEvents(item.find('a.action'));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
|
|
||||||
item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
|
|
||||||
this._registerAddEvents(item.find('a.action'));
|
|
||||||
}
|
|
||||||
|
|
||||||
this._registerDoubleClickEvents(item);
|
|
||||||
this._registerHoverEvents(item);
|
|
||||||
},
|
|
||||||
// taken from John Resig's liveUpdate script
|
|
||||||
_filter: function(list) {
|
|
||||||
var input = $(this);
|
|
||||||
var rows = list.children('li'),
|
|
||||||
cache = rows.map(function(){
|
|
||||||
|
|
||||||
return $(this).text().toLowerCase();
|
|
||||||
});
|
|
||||||
|
|
||||||
var term = $.trim(input.val().toLowerCase()), scores = [];
|
|
||||||
|
|
||||||
if (!term) {
|
|
||||||
rows.show();
|
|
||||||
} else {
|
|
||||||
rows.hide();
|
|
||||||
|
|
||||||
cache.each(function(i) {
|
|
||||||
if (this.indexOf(term)>-1) { scores.push(i); }
|
|
||||||
});
|
|
||||||
|
|
||||||
$.each(scores, function() {
|
|
||||||
$(rows[this]).show();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_registerDoubleClickEvents: function(elements) {
|
|
||||||
if (!this.options.doubleClickable) return;
|
|
||||||
elements.dblclick(function() {
|
|
||||||
elements.find('a.action').click();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
_registerHoverEvents: function(elements) {
|
|
||||||
elements.removeClass('ui-state-hover');
|
|
||||||
elements.mouseover(function() {
|
|
||||||
$(this).addClass('ui-state-hover');
|
|
||||||
});
|
|
||||||
elements.mouseout(function() {
|
|
||||||
$(this).removeClass('ui-state-hover');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
_registerAddEvents: function(elements) {
|
|
||||||
var that = this;
|
|
||||||
elements.click(function() {
|
|
||||||
var item = that._setSelected($(this).parent(), true);
|
|
||||||
that.count += 1;
|
|
||||||
that._updateCount();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
// make draggable
|
|
||||||
if (this.options.sortable) {
|
|
||||||
elements.each(function() {
|
|
||||||
$(this).parent().draggable({
|
|
||||||
connectToSortable: that.selectedList,
|
|
||||||
helper: function() {
|
|
||||||
var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
|
|
||||||
selectedItem.width($(this).width());
|
|
||||||
return selectedItem;
|
|
||||||
},
|
|
||||||
appendTo: that.container,
|
|
||||||
containment: that.container,
|
|
||||||
revert: 'invalid'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
_registerRemoveEvents: function(elements) {
|
|
||||||
var that = this;
|
|
||||||
elements.click(function() {
|
|
||||||
that._setSelected($(this).parent(), false);
|
|
||||||
that.count -= 1;
|
|
||||||
that._updateCount();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
_registerSearchEvents: function(input) {
|
|
||||||
var that = this;
|
|
||||||
|
|
||||||
input.focus(function() {
|
|
||||||
$(this).addClass('ui-state-active');
|
|
||||||
})
|
|
||||||
.blur(function() {
|
|
||||||
$(this).removeClass('ui-state-active');
|
|
||||||
})
|
|
||||||
.keypress(function(e) {
|
|
||||||
if (e.keyCode == 13)
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
.keyup(function() {
|
|
||||||
that._filter.apply(this, [that.availableList]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.extend($.ui.multiselect, {
|
|
||||||
locale: {
|
|
||||||
addAll:'Add all',
|
|
||||||
removeAll:'Remove all',
|
|
||||||
itemsCount:'items selected'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
@ -1180,7 +1180,7 @@ XDebugInstalled=XDebug is loaded.
|
|||||||
XCacheInstalled=XCache is loaded.
|
XCacheInstalled=XCache is loaded.
|
||||||
AddRefInList=Display Customer/Supplier ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp".
|
AddRefInList=Display Customer/Supplier ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp".
|
||||||
AddAdressInList=Display Customer/Supplier adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp".
|
AddAdressInList=Display Customer/Supplier adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp".
|
||||||
AskForPreferredShippingMethod=Ask for preferred sending method for Third Parties.
|
AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties.
|
||||||
FieldEdition=Edition of field %s
|
FieldEdition=Edition of field %s
|
||||||
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced)
|
||||||
GetBarCode=Get barcode
|
GetBarCode=Get barcode
|
||||||
@ -1199,8 +1199,8 @@ UserMailRequired=EMail required to create a new user
|
|||||||
HRMSetup=HRM module setup
|
HRMSetup=HRM module setup
|
||||||
##### Company setup #####
|
##### Company setup #####
|
||||||
CompanySetup=Companies module setup
|
CompanySetup=Companies module setup
|
||||||
CompanyCodeChecker=Options for automatic generation of customer/supplier codes
|
CompanyCodeChecker=Options for automatic generation of customer / vendor codes
|
||||||
AccountCodeManager=Options for automatic generation of customer/supplier accounting codes
|
AccountCodeManager=Options for automatic generation of customer / vendor accounting codes
|
||||||
NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events. Targets of notifications can be defined:
|
NotificationsDesc=EMails notifications feature allows you to silently send automatic mail, for some Dolibarr events. Targets of notifications can be defined:
|
||||||
NotificationsDescUser=* per users, one user at time.
|
NotificationsDescUser=* per users, one user at time.
|
||||||
NotificationsDescContact=* per third parties contacts (customers or vendors), one contact at time.
|
NotificationsDescContact=* per third parties contacts (customers or vendors), one contact at time.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -389,37 +389,37 @@ class Loan extends CommonObject
|
|||||||
if ($mode == 0 || $mode == 1)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == 0) return $langs->trans("Unpaid");
|
if ($statut == 0) return $langs->trans("Unpaid");
|
||||||
if ($statut == 1) return $langs->trans("Paid");
|
elseif ($statut == 1) return $langs->trans("Paid");
|
||||||
}
|
}
|
||||||
elseif ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
elseif ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
|
||||||
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
elseif ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
|
||||||
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
elseif ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
elseif ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
|
||||||
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
elseif ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
|
||||||
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
elseif ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
|
||||||
}
|
}
|
||||||
|
|
||||||
else return "Error, mode/status not found";
|
else return "Error, mode/status not found";
|
||||||
|
|||||||
@ -68,6 +68,22 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
|
/**
|
||||||
|
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
|
||||||
|
*
|
||||||
|
* @param string $val Value
|
||||||
|
* @param string $type 1=GET, 0=POST, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
|
||||||
|
* @return int >0 if there is an injection, 0 if none
|
||||||
|
* @deprecated use testSqlAndScriptInject
|
||||||
|
* @see testSqlAndScriptInject($val, $type)
|
||||||
|
*/
|
||||||
|
function test_sql_and_script_inject($val, $type)
|
||||||
|
{
|
||||||
|
// phpcs:enable
|
||||||
|
return testSqlAndScriptInject($val, $type);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
|
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF).
|
||||||
*
|
*
|
||||||
@ -75,7 +91,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP
|
|||||||
* @param string $type 1=GET, 0=POST, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
|
* @param string $type 1=GET, 0=POST, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
|
||||||
* @return int >0 if there is an injection, 0 if none
|
* @return int >0 if there is an injection, 0 if none
|
||||||
*/
|
*/
|
||||||
function test_sql_and_script_inject($val, $type)
|
function testSqlAndScriptInject($val, $type)
|
||||||
{
|
{
|
||||||
$inj = 0;
|
$inj = 0;
|
||||||
// For SQL Injection (only GET are used to be included into bad escaped SQL requests)
|
// For SQL Injection (only GET are used to be included into bad escaped SQL requests)
|
||||||
@ -158,7 +174,7 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return (test_sql_and_script_inject($var, $type) <= 0);
|
return (testSqlAndScriptInject($var, $type) <= 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1296,7 +1312,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext?'?'.$ext:'').'"></script>'."\n"; // We include full because we need the support of containerCssClass
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext?'?'.$ext:'').'"></script>'."\n"; // We include full because we need the support of containerCssClass
|
||||||
}
|
}
|
||||||
}
|
if (! defined('DISABLE_MULTISELECT')) // jQuery plugin "mutiselect" to select with checkboxes
|
||||||
|
{
|
||||||
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $disablejs && ! empty($conf->use_javascript_ajax))
|
if (! $disablejs && ! empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,10 +84,10 @@ $search_categ_cus=trim(GETPOST("search_categ_cus",'int'));
|
|||||||
$search_categ_sup=trim(GETPOST("search_categ_sup",'int'));
|
$search_categ_sup=trim(GETPOST("search_categ_sup",'int'));
|
||||||
$search_country=GETPOST("search_country",'intcomma');
|
$search_country=GETPOST("search_country",'intcomma');
|
||||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||||
|
$search_staff=GETPOST("search_staff",'int');
|
||||||
$search_status=GETPOST("search_status",'int');
|
$search_status=GETPOST("search_status",'int');
|
||||||
$search_type=GETPOST('search_type','alpha');
|
$search_type=GETPOST('search_type','alpha');
|
||||||
$search_level_from = GETPOST("search_level_from","alpha");
|
$search_level = GETPOST("search_level", "array");
|
||||||
$search_level_to = GETPOST("search_level_to","alpha");
|
|
||||||
$search_stcomm=GETPOST('search_stcomm','int');
|
$search_stcomm=GETPOST('search_stcomm','int');
|
||||||
$search_import_key = GETPOST("search_import_key","alpha");
|
$search_import_key = GETPOST("search_import_key","alpha");
|
||||||
$search_btn=GETPOST('button_search','alpha');
|
$search_btn=GETPOST('button_search','alpha');
|
||||||
@ -184,6 +184,7 @@ $arrayfields=array(
|
|||||||
's.phone'=>array('label'=>"Phone", 'checked'=>1),
|
's.phone'=>array('label'=>"Phone", 'checked'=>1),
|
||||||
's.fax'=>array('label'=>"Fax", 'checked'=>0),
|
's.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||||
|
'staff.code'=>array('label'=>"Staff", 'checked'=>0),
|
||||||
's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1),
|
's.siren'=>array('label'=>"ProfId1Short", 'checked'=>$checkedprofid1),
|
||||||
's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2),
|
's.siret'=>array('label'=>"ProfId2Short", 'checked'=>$checkedprofid2),
|
||||||
's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3),
|
's.ape'=>array('label'=>"ProfId3Short", 'checked'=>$checkedprofid3),
|
||||||
@ -258,10 +259,10 @@ if (empty($reshook))
|
|||||||
$search_vat='';
|
$search_vat='';
|
||||||
$search_type='';
|
$search_type='';
|
||||||
$search_type_thirdparty='';
|
$search_type_thirdparty='';
|
||||||
|
$search_staff='';
|
||||||
$search_status=-1;
|
$search_status=-1;
|
||||||
$search_stcomm='';
|
$search_stcomm='';
|
||||||
$search_level_from='';
|
$search_level='';
|
||||||
$search_level_to='';
|
|
||||||
$search_import_key='';
|
$search_import_key='';
|
||||||
$toselect='';
|
$toselect='';
|
||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
@ -318,80 +319,22 @@ if ($type == 'c' && (empty($search_type) || ($search_type == '1,3'))) $title=$la
|
|||||||
if ($type == 'p' && (empty($search_type) || ($search_type == '2,3'))) $title=$langs->trans("ListOfProspects");
|
if ($type == 'p' && (empty($search_type) || ($search_type == '2,3'))) $title=$langs->trans("ListOfProspects");
|
||||||
if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) $title=$langs->trans("ListOfSuppliers");
|
if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) $title=$langs->trans("ListOfSuppliers");
|
||||||
|
|
||||||
// If both parameters are set, search for everything BETWEEN them
|
|
||||||
if ($search_level_from != '' && $search_level_to != '')
|
|
||||||
{
|
|
||||||
// Ensure that these parameters are numbers
|
|
||||||
$search_level_from = (int) $search_level_from;
|
|
||||||
$search_level_to = (int) $search_level_to;
|
|
||||||
|
|
||||||
// If from is greater than to, reverse orders
|
|
||||||
if ($search_level_from > $search_level_to)
|
|
||||||
{
|
|
||||||
$tmp = $search_level_to;
|
|
||||||
$search_level_to = $search_level_from;
|
|
||||||
$search_level_from = $tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate the SQL request
|
|
||||||
$sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range';
|
|
||||||
}
|
|
||||||
// If only "from" parameter is set, search for everything GREATER THAN it
|
|
||||||
else if ($search_level_from != '')
|
|
||||||
{
|
|
||||||
// Ensure that this parameter is a number
|
|
||||||
$search_level_from = (int) $search_level_from;
|
|
||||||
|
|
||||||
// Generate the SQL request
|
|
||||||
$sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range';
|
|
||||||
}
|
|
||||||
// If only "to" parameter is set, search for everything LOWER THAN it
|
|
||||||
else if ($search_level_to != '')
|
|
||||||
{
|
|
||||||
// Ensure that this parameter is a number
|
|
||||||
$search_level_to = (int) $search_level_to;
|
|
||||||
|
|
||||||
// Generate the SQL request
|
|
||||||
$sortwhere = '(sortorder <= '.$search_level_to.') AS is_in_range';
|
|
||||||
}
|
|
||||||
// If no parameters are set, dont search for anything
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sortwhere = '0 as is_in_range';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Select every potentiels, and note each potentiels which fit in search parameters
|
// Select every potentiels, and note each potentiels which fit in search parameters
|
||||||
dol_syslog('societe/list.php',LOG_DEBUG);
|
$tab_level = array();
|
||||||
$sql = "SELECT code, label, sortorder, ".$sortwhere;
|
$sql = "SELECT code, label, sortorder";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||||
$sql.= " WHERE active > 0";
|
$sql.= " WHERE active > 0";
|
||||||
$sql.= " ORDER BY sortorder";
|
$sql.= " ORDER BY sortorder";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$tab_level = array();
|
|
||||||
$search_levels = array();
|
|
||||||
|
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
// Compute level text
|
// Compute level text
|
||||||
$level=$langs->trans($obj->code);
|
$level=$langs->trans($obj->code);
|
||||||
if ($level == $obj->code) $level=$langs->trans($obj->label);
|
if ($level == $obj->code) $level=$langs->trans($obj->label);
|
||||||
|
$tab_level[$obj->code] = $level;
|
||||||
// Put it in the array sorted by sortorder
|
|
||||||
$tab_level[$obj->sortorder] = $level;
|
|
||||||
|
|
||||||
// If this potentiel fit in parameters, add its code to the $search_levels array
|
|
||||||
if ($obj->is_in_range == 1)
|
|
||||||
{
|
|
||||||
$search_levels[] = '"'.preg_replace('[^A-Za-z0-9_-]', '', $obj->code).'"';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implode the $search_levels array so that it can be use in a "IN (...)" where clause.
|
|
||||||
// If no paramters was set, $search_levels will be empty
|
|
||||||
$search_levels = implode(',', $search_levels);
|
|
||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
@ -401,6 +344,7 @@ $sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2,
|
|||||||
$sql.= " s.tms as date_update, s.datec as date_creation,";
|
$sql.= " s.tms as date_update, s.datec as date_creation,";
|
||||||
$sql.= " s.code_compta,s.code_compta_fournisseur,";
|
$sql.= " s.code_compta,s.code_compta_fournisseur,";
|
||||||
$sql.= " typent.code as typent_code,";
|
$sql.= " typent.code as typent_code,";
|
||||||
|
$sql.= " staff.code as staff_code,";
|
||||||
$sql.= " country.code as country_code,";
|
$sql.= " country.code as country_code,";
|
||||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
$sql.= " region.code_region as region_code, region.nom as region_name";
|
$sql.= " region.code_region as region_code, region.nom as region_name";
|
||||||
@ -419,6 +363,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_effectif)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)";
|
||||||
// We'll need this table joined to the select in order to filter by categ
|
// We'll need this table joined to the select in order to filter by categ
|
||||||
@ -452,8 +397,8 @@ if ($search_account_supplier_code) $sql.= natural_search("s.code_compta_fourniss
|
|||||||
if ($search_town) $sql.= natural_search("s.town",$search_town);
|
if ($search_town) $sql.= natural_search("s.town",$search_town);
|
||||||
if (strlen($search_zip)) $sql.= natural_search("s.zip",$search_zip);
|
if (strlen($search_zip)) $sql.= natural_search("s.zip",$search_zip);
|
||||||
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
if ($search_state) $sql.= natural_search("state.nom",$search_state);
|
||||||
if ($search_region) $sql.= natural_search("region.nom",$search_region);
|
if ($search_region) $sql.= natural_search("region.nom",$search_region);
|
||||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
|
if ($search_country && $search_country != '-1') $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
|
||||||
if ($search_email) $sql.= natural_search("s.email",$search_email);
|
if ($search_email) $sql.= natural_search("s.email",$search_email);
|
||||||
if (strlen($search_phone)) $sql.= natural_search("s.phone", $search_phone);
|
if (strlen($search_phone)) $sql.= natural_search("s.phone", $search_phone);
|
||||||
if (strlen($search_fax)) $sql.= natural_search("s.phone", $search_fax);
|
if (strlen($search_fax)) $sql.= natural_search("s.phone", $search_fax);
|
||||||
@ -469,11 +414,12 @@ if (strlen($search_vat)) $sql.= natural_search("s.tva_intra",$search_vat);
|
|||||||
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
|
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
|
||||||
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
|
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
|
||||||
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
|
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
|
||||||
if ($search_status!='' && $search_status >= 0) $sql .= " AND s.status = ".$db->escape($search_status);
|
if ($search_status!='' && $search_status >= 0) $sql .= natural_search("s.status", $search_status, 2);
|
||||||
if (!empty($conf->barcode->enabled) && $search_barcode) $sql.= natural_search("s.barcode", $search_barcode);
|
if (!empty($conf->barcode->enabled) && $search_barcode) $sql.= natural_search("s.barcode", $search_barcode);
|
||||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
|
if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql.= natural_search("s.fk_typent", $search_type_thirdparty, 2);
|
||||||
if ($search_levels) $sql .= " AND s.fk_prospectlevel IN (".$search_levels.')';
|
if (! empty($search_staff) && $search_staff != '-1') $sql.= natural_search("s.fk_effectif", $search_staff, 2);
|
||||||
if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
|
if ($search_level) $sql .= natural_search("s.fk_prospectlevel", join(',', $search_level), 3);
|
||||||
|
if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm", $search_stcomm, 2);
|
||||||
if ($search_import_key) $sql.= natural_search("s.import_key",$search_import_key);
|
if ($search_import_key) $sql.= natural_search("s.import_key",$search_import_key);
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
@ -566,13 +512,12 @@ if ($search_idprof6 != '') $param.= '&search_idprof6='.urlencode($search_idprof6
|
|||||||
if ($search_vat != '') $param.= '&search_vat='.urlencode($search_vat);
|
if ($search_vat != '') $param.= '&search_vat='.urlencode($search_vat);
|
||||||
if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty);
|
if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty);
|
||||||
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
|
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
|
||||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
if (is_array($search_level) && count($search_level)) foreach($search_level as $slevel) $param.='&search_level[]='.urlencode($slevel);
|
||||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||||
if ($search_stcomm != '') $param.='&search_stcomm='.urlencode($search_stcomm);
|
if ($search_stcomm != '') $param.='&search_stcomm='.urlencode($search_stcomm);
|
||||||
if ($search_level_from != '') $param.='&search_level_from='.urlencode($search_level_from);
|
|
||||||
if ($search_level_to != '') $param.='&search_level_to='.urlencode($search_level_to);
|
|
||||||
if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
|
if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
|
||||||
if ($type != '') $param.='&type='.urlencode($type);
|
if ($type != '') $param.='&type='.urlencode($type);
|
||||||
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
@ -796,6 +741,13 @@ if (! empty($arrayfields['typent.code']['checked']))
|
|||||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Staff
|
||||||
|
if (! empty($arrayfields['staff.code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||||
|
print $form->selectarray("search_staff", $formcompany->effectif_array(0), $search_staff, 0, 0, 0, '', 0, 0, 0, $sort, 'maxwidth100');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (! empty($arrayfields['s.email']['checked']))
|
if (! empty($arrayfields['s.email']['checked']))
|
||||||
{
|
{
|
||||||
// Email
|
// Email
|
||||||
@ -888,37 +840,16 @@ if (! empty($arrayfields['customerorsupplier']['checked']))
|
|||||||
print '<option value="0"'.($search_type=='0'?' selected':'').'>'.$langs->trans('Others').'</option>';
|
print '<option value="0"'.($search_type=='0'?' selected':'').'>'.$langs->trans('Others').'</option>';
|
||||||
print '</select></td>';
|
print '</select></td>';
|
||||||
}
|
}
|
||||||
|
// Prospect level
|
||||||
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
||||||
{
|
{
|
||||||
// Prospect level
|
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
$options_from = '<option value=""> </option>'; // Generate in $options_from the list of each option sorted
|
print $form->multiselectarray('search_level', $tab_level, $search_level, 0, 0, 'width75', 0, 0, '', '', '', 2);
|
||||||
foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
|
|
||||||
{
|
|
||||||
$options_from .= '<option value="'.$tab_level_sortorder.'"'.($search_level_from == $tab_level_sortorder ? ' selected':'').'>';
|
|
||||||
$options_from .= $langs->trans($tab_level_label);
|
|
||||||
$options_from .= '</option>';
|
|
||||||
}
|
|
||||||
array_reverse($tab_level, true); // Reverse the list
|
|
||||||
$options_to = '<option value=""> </option>'; // Generate in $options_to the list of each option sorted in the reversed order
|
|
||||||
foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
|
|
||||||
{
|
|
||||||
$options_to .= '<option value="'.$tab_level_sortorder.'"'.($search_level_to == $tab_level_sortorder ? ' selected':'').'>';
|
|
||||||
$options_to .= $langs->trans($tab_level_label);
|
|
||||||
$options_to .= '</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print these two select
|
|
||||||
print $langs->trans("From").' <select class="flat" name="search_level_from">'.$options_from.'</select>';
|
|
||||||
print ' ';
|
|
||||||
print $langs->trans("to").' <select class="flat" name="search_level_to">'.$options_to.'</select>';
|
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Prospect status
|
||||||
if (! empty($arrayfields['s.fk_stcomm']['checked']))
|
if (! empty($arrayfields['s.fk_stcomm']['checked']))
|
||||||
{
|
{
|
||||||
// Prospect status
|
|
||||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
||||||
$arraystcomm=array();
|
$arraystcomm=array();
|
||||||
foreach($prospectstatic->cacheprospectstatus as $key => $val)
|
foreach($prospectstatic->cacheprospectstatus as $key => $val)
|
||||||
@ -950,7 +881,7 @@ if (! empty($arrayfields['s.tms']['checked']))
|
|||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['s.status']['checked']))
|
if (! empty($arrayfields['s.status']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
print '<td class="liste_titre center minwidth75imp">';
|
||||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $search_status, 1);
|
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $search_status, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -983,6 +914,7 @@ if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titr
|
|||||||
if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'],$_SERVER["PHP_SELF"],"staff.code","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'],$_SERVER["PHP_SELF"],"s.email","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'],$_SERVER["PHP_SELF"],"s.email","",$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['s.phone']['checked'])) print_liste_field_titre($arrayfields['s.phone']['label'],$_SERVER["PHP_SELF"],"s.phone","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.phone']['checked'])) print_liste_field_titre($arrayfields['s.phone']['label'],$_SERVER["PHP_SELF"],"s.phone","",$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['s.fax']['checked'])) print_liste_field_titre($arrayfields['s.fax']['label'],$_SERVER["PHP_SELF"],"s.fax","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.fax']['checked'])) print_liste_field_titre($arrayfields['s.fax']['label'],$_SERVER["PHP_SELF"],"s.fax","",$param,'',$sortfield,$sortorder);
|
||||||
@ -1131,6 +1063,15 @@ while ($i < min($num, $limit))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Staff
|
||||||
|
if (! empty($arrayfields['staff.code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
if (! is_array($staffArray) || count($staffArray)==0) $staffArray = $formcompany->effectif_array(1);
|
||||||
|
print $staffArray[$obj->staff_code];
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
if (! empty($arrayfields['s.email']['checked']))
|
if (! empty($arrayfields['s.email']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->email."</td>\n";
|
print "<td>".$obj->email."</td>\n";
|
||||||
|
|||||||
@ -62,14 +62,16 @@ llxHeader('', $langs->trans("StripeChargeList"));
|
|||||||
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
|
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
|
||||||
{
|
{
|
||||||
$service = 'StripeTest';
|
$service = 'StripeTest';
|
||||||
|
$servicestatus = '0';
|
||||||
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$service = 'StripeLive';
|
$service = 'StripeLive';
|
||||||
|
$servicestatus = '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$stripeaccount = $stripe->getStripeAccount($service);
|
$stripeacc = $stripe->getStripeAccount($service);
|
||||||
/*if (empty($stripeaccount))
|
/*if (empty($stripeaccount))
|
||||||
{
|
{
|
||||||
print $langs->trans('ErrorStripeAccountNotDefined');
|
print $langs->trans('ErrorStripeAccountNotDefined');
|
||||||
@ -87,7 +89,7 @@ if (!$rowid)
|
|||||||
print '<INPUT type="hidden" name="page" value="'.$page.'">';
|
print '<INPUT type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
$title=$langs->trans("StripeChargeList");
|
$title=$langs->trans("StripeChargeList");
|
||||||
$title.=($stripeaccount?' (Stripe connection with Stripe OAuth Connect account '.$stripeaccount.')':' (Stripe connection with keys from Stripe module setup)');
|
$title.=($stripeacc?' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)');
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit);
|
||||||
|
|
||||||
@ -107,9 +109,9 @@ if (!$rowid)
|
|||||||
|
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
if ($stripeaccount)
|
if ($stripeacc)
|
||||||
{
|
{
|
||||||
$list=\Stripe\Charge::all(array("limit" => $limit), array("stripe_account" => $stripeaccount));
|
$list=\Stripe\Charge::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -147,15 +149,28 @@ if (!$rowid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<TR class="oddeven">';
|
print '<TR class="oddeven">';
|
||||||
|
|
||||||
|
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
$url='https://dashboard.stripe.com/test/payments/'.$charge->id;
|
$url='https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id;
|
||||||
if ($servicestatus)
|
if ($servicestatus)
|
||||||
{
|
{
|
||||||
$url='https://dashboard.stripe.com/payments/'.$charge->id;
|
$url='https://dashboard.stripe.com/'.$connect.'payments/'.$charge->id;
|
||||||
}
|
}
|
||||||
print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n";
|
print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n";
|
||||||
// Stripe customer
|
// Stripe customer
|
||||||
print "<TD>".$charge->customer."</TD>\n";
|
print "<TD>";
|
||||||
|
|
||||||
|
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
|
||||||
|
$url='https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer;
|
||||||
|
if ($servicestatus)
|
||||||
|
{
|
||||||
|
$url='https://dashboard.stripe.com/'.$connect.'customers/'.$charge->customer;
|
||||||
|
}
|
||||||
|
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').' '.$charge->customer.'</a>';
|
||||||
|
|
||||||
|
print "</TD>\n";
|
||||||
// Link
|
// Link
|
||||||
print "<TD>";
|
print "<TD>";
|
||||||
if ($societestatic->id > 0)
|
if ($societestatic->id > 0)
|
||||||
@ -198,7 +213,7 @@ if (!$rowid)
|
|||||||
}
|
}
|
||||||
print '</TD>';
|
print '</TD>';
|
||||||
// Amount
|
// Amount
|
||||||
print "<TD align=\"right\">".price(($charge->amount-$charge->amount_refunded)/100)."</TD>";
|
print "<TD align=\"right\">".price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</TD>";
|
||||||
// Status
|
// Status
|
||||||
print '<TD align="right">';
|
print '<TD align="right">';
|
||||||
if ($charge->refunded=='1'){
|
if ($charge->refunded=='1'){
|
||||||
|
|||||||
@ -103,7 +103,7 @@ if (! $rowid) {
|
|||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||||
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
//print_liste_field_titre("StripeCustomerId",$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder);
|
||||||
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
//print_liste_field_titre("CustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
//print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", 'align="left"', $sortfield, $sortorder);
|
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", 'align="left"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", 'align="right"', $sortfield, $sortorder);
|
||||||
@ -177,28 +177,35 @@ if (! $rowid) {
|
|||||||
}
|
}
|
||||||
print "</td>\n";*/
|
print "</td>\n";*/
|
||||||
// Origine
|
// Origine
|
||||||
print "<td>";
|
|
||||||
print $FULLTAG;
|
//print "<TD>";
|
||||||
if ($charge->metadata->source=="order"){
|
////if ($charge->metadata->dol_type=="order"){
|
||||||
$object = new Commande($db);
|
// $object = new Commande($db);
|
||||||
$object->fetch($charge->metadata->idsource);
|
// $object->fetch($charge->metadata->dol_id);
|
||||||
print "<a href='".DOL_URL_ROOT."/commande/card.php?id=".$charge->metadata->idsource."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
|
// print "<A href='".DOL_URL_ROOT."/commande/card.php?id=".$charge->metadata->dol_id."'>".img_picto('', 'object_order')." ".$object->ref."</A>";
|
||||||
} elseif ($charge->metadata->source=="invoice") {
|
//} elseif ($charge->metadata->dol_type=="invoice"){
|
||||||
$object = new Facture($db);
|
// $object = new Facture($db);
|
||||||
$object->fetch($charge->metadata->idsource);
|
// $object->fetch($charge->metadata->dol_id);
|
||||||
print "<a href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->idsource."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
|
// print "<A href='".DOL_URL_ROOT."/compta/facture/card.php?facid=".$charge->metadata->dol_id."'>".img_picto('', 'object_invoice')." ".$object->ref."</A>";
|
||||||
}
|
//}
|
||||||
print "</td>\n";
|
//print "</TD>\n";
|
||||||
// Date payment
|
// Date payment
|
||||||
print '<td align="center">' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . "</td>\n";
|
print '<td align="center">' . dol_print_date($txn->created, '%d/%m/%Y %H:%M') . "</td>\n";
|
||||||
// Type
|
// Type
|
||||||
print '<td>' . $txn->type . '</td>';
|
print '<td>' . $txn->type . '</td>';
|
||||||
// Amount
|
// Amount
|
||||||
print "<td align=\"right\">" . price(($txn->amount) / 100) . "</td>";
|
print "<td align=\"right\">" . price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</td>";
|
||||||
print "<td align=\"right\">" . price(($txn->fee) / 100) . "</td>";
|
print "<td align=\"right\">" . price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)) . "</td>";
|
||||||
// Status
|
// Status
|
||||||
print "<td align='right'>";
|
print "<td align='right'>";
|
||||||
print $txn->status;
|
if ($txn->status=='available')
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("".$txn->status.""),'statut4');}
|
||||||
|
elseif ($txn->status=='pending')
|
||||||
|
{print img_picto($langs->trans("".$txn->status.""),'statut7');}
|
||||||
|
elseif ($txn->status=='failed')
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("".$txn->status.""),'statut8');}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1884,16 +1884,27 @@ if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
|
|||||||
}
|
}
|
||||||
.login_table input#username, .login_table input#password, .login_table input#securitycode {
|
.login_table input#username, .login_table input#password, .login_table input#securitycode {
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: solid 1px rgba(180,180,180,.4);
|
/* border-bottom: solid 1px rgba(180,180,180,.4); */
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
.login_table input#username:focus, .login_table input#password:focus, .login_table input#securitycode:focus {
|
.login_table input#username:focus, .login_table input#password:focus, .login_table input#securitycode:focus {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
/* box-shadow: none;
|
}
|
||||||
-webkit-box-shadow: 0 0 0 50px #FFF inset;
|
.login_table .trinputlogin {
|
||||||
box-shadow: 0 0 0 50px #FFF inset;*/
|
margin: 8px;
|
||||||
|
}
|
||||||
|
.login_table .tdinputlogin {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 2px solid #ccc;
|
||||||
|
min-width: 200px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.login_table .tdinputlogin .fa {
|
||||||
|
padding-left: 10px;
|
||||||
|
width: 14px;
|
||||||
}
|
}
|
||||||
.login_main_message {
|
.login_main_message {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -2707,7 +2718,9 @@ table.paddingtopbottomonly tr td {
|
|||||||
background: rgb(<?php echo $colorbacktitle1; ?>) !important;
|
background: rgb(<?php echo $colorbacktitle1; ?>) !important;
|
||||||
}
|
}
|
||||||
tr.liste_titre_filter td.liste_titre {
|
tr.liste_titre_filter td.liste_titre {
|
||||||
/* border-bottom: 1px solid #ddd; */
|
/* border-bottom: 1px solid #ddd; */
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
|
.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
|
||||||
{
|
{
|
||||||
@ -4902,7 +4915,81 @@ span.noborderoncategories {
|
|||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Multiselect with checkbox */
|
/* External lib multiselect with checkbox */
|
||||||
|
/* ============================================================================== */
|
||||||
|
|
||||||
|
.multi-select-container {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menu {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0.8em;
|
||||||
|
float: left;
|
||||||
|
min-width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0.4em 0;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menu input {
|
||||||
|
margin-right: 0.3em;
|
||||||
|
vertical-align: 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-button {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 20em;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 2px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
.multi-select-button:focus {
|
||||||
|
outline: none;
|
||||||
|
border-bottom: 1px solid #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-button:after {
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0.5em 0.23em 0em 0.23em;
|
||||||
|
border-color: #444 transparent transparent transparent;
|
||||||
|
margin-left: 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-container--open .multi-select-menu { display: block; }
|
||||||
|
|
||||||
|
.multi-select-container--open .multi-select-button:after {
|
||||||
|
border-width: 0 0.4em 0.4em 0.4em;
|
||||||
|
border-color: transparent transparent #999 transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menuitem {
|
||||||
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
padding-left: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ============================================================================== */
|
||||||
|
/* Native multiselect with checkbox */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
ul.ulselectedfields {
|
ul.ulselectedfields {
|
||||||
|
|||||||
@ -1875,17 +1875,29 @@ form#login {
|
|||||||
}
|
}
|
||||||
.login_table input#username, .login_table input#password, .login_table input#securitycode{
|
.login_table input#username, .login_table input#password, .login_table input#securitycode{
|
||||||
border: none;
|
border: none;
|
||||||
border-bottom: solid 1px rgba(180,180,180,.4);
|
/* border-bottom: solid 1px rgba(180,180,180,.4); */
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin-left: 18px;
|
margin-left: 18px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
.login_table input#username:focus, .login_table input#password:focus, .login_table input#securitycode:focus {
|
.login_table input#username:focus, .login_table input#password:focus, .login_table input#securitycode:focus {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
/* box-shadow: none;
|
|
||||||
-webkit-box-shadow: 0 0 0 50px #FFF inset;
|
|
||||||
box-shadow: 0 0 0 50px #FFF inset;*/
|
|
||||||
}
|
}
|
||||||
|
.login_table .trinputlogin {
|
||||||
|
margin: 8px;
|
||||||
|
}
|
||||||
|
.login_table .tdinputlogin {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 2px solid #ccc;
|
||||||
|
min-width: 200px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.login_table .tdinputlogin .fa {
|
||||||
|
padding-left: 10px;
|
||||||
|
width: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.login_main_message {
|
.login_main_message {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
max-width: 570px;
|
max-width: 570px;
|
||||||
@ -2673,6 +2685,8 @@ table.paddingtopbottomonly tr td {
|
|||||||
}
|
}
|
||||||
tr.liste_titre_filter td.liste_titre {
|
tr.liste_titre_filter td.liste_titre {
|
||||||
border-bottom: 1px solid #FDFFFF;
|
border-bottom: 1px solid #FDFFFF;
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
|
.liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd
|
||||||
{
|
{
|
||||||
@ -4760,7 +4774,81 @@ span.noborderoncategories {
|
|||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Multiselect with checkbox */
|
/* External lib multiselect with checkbox */
|
||||||
|
/* ============================================================================== */
|
||||||
|
|
||||||
|
.multi-select-container {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menu {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0.8em;
|
||||||
|
float: left;
|
||||||
|
min-width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0.4em 0;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menu input {
|
||||||
|
margin-right: 0.3em;
|
||||||
|
vertical-align: 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-button {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 20em;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-bottom: solid 1px rgba(0,0,0,.2);
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 2px;
|
||||||
|
height: 17px;
|
||||||
|
}
|
||||||
|
.multi-select-button:focus {
|
||||||
|
outline: none;
|
||||||
|
border-bottom: 1px solid #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-button:after {
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0.5em 0.23em 0em 0.23em;
|
||||||
|
border-color: #444 transparent transparent transparent;
|
||||||
|
margin-left: 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-container--open .multi-select-menu { display: block; }
|
||||||
|
|
||||||
|
.multi-select-container--open .multi-select-button:after {
|
||||||
|
border-width: 0 0.4em 0.4em 0.4em;
|
||||||
|
border-color: transparent transparent #999 transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-menuitem {
|
||||||
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
padding-left: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ============================================================================== */
|
||||||
|
/* Native multiselect with checkbox */
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
ul.ulselectedfields {
|
ul.ulselectedfields {
|
||||||
|
|||||||
@ -110,6 +110,12 @@ if (empty($reshook)) {
|
|||||||
$tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
|
$tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
|
||||||
|
$tabparam["AGENDA_DEFAULT_VIEW"] = $_POST["AGENDA_DEFAULT_VIEW"];
|
||||||
|
} else {
|
||||||
|
$tabparam["AGENDA_DEFAULT_VIEW"] = '';
|
||||||
|
}
|
||||||
|
|
||||||
if (GETPOST("check_MAIN_THEME") == "on") {
|
if (GETPOST("check_MAIN_THEME") == "on") {
|
||||||
$tabparam["MAIN_THEME"] = $_POST["main_theme"];
|
$tabparam["MAIN_THEME"] = $_POST["main_theme"];
|
||||||
} else {
|
} else {
|
||||||
@ -223,6 +229,9 @@ if ($action == 'edit')
|
|||||||
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
|
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
|
||||||
else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
|
else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
|
if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
|
||||||
|
else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
|
if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
|
||||||
else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
|
else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
|
||||||
|
|
||||||
@ -231,8 +240,9 @@ if ($action == 'edit')
|
|||||||
}
|
}
|
||||||
init_myfunc();
|
init_myfunc();
|
||||||
jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
|
jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
|
||||||
jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
|
|
||||||
jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
|
jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
|
||||||
|
jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
|
||||||
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
|
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
|
||||||
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
|
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
|
||||||
jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
|
jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
|
||||||
@ -251,7 +261,7 @@ if ($action == 'edit')
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
|
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left" class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANDING_PAGE" id="check_MAIN_LANDING_PAGE" type="checkbox" '.(! empty($object->conf->MAIN_LANDING_PAGE)?" checked":"");
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANDING_PAGE" id="check_MAIN_LANDING_PAGE" type="checkbox" '.(! empty($object->conf->MAIN_LANDING_PAGE)?" checked":"");
|
||||||
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -259,28 +269,40 @@ if ($action == 'edit')
|
|||||||
//print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
|
//print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Langue par defaut
|
// Language by default
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
||||||
print $s?$s.' ':'';
|
print $s?$s.' ':'';
|
||||||
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left" class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" '.(! empty($object->conf->MAIN_LANG_DEFAULT)?" checked":"");
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" '.(! empty($object->conf->MAIN_LANG_DEFAULT)?" checked":"");
|
||||||
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formadmin->select_language((! empty($object->conf->MAIN_LANG_DEFAULT)?$object->conf->MAIN_LANG_DEFAULT:''),'main_lang_default',1,null,0,0,(! empty($dolibarr_main_demo)));
|
print $formadmin->select_language((! empty($object->conf->MAIN_LANG_DEFAULT)?$object->conf->MAIN_LANG_DEFAULT:''),'main_lang_default',1,null,0,0,(! empty($dolibarr_main_demo)));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Taille max des listes
|
// Max size of lists
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
||||||
print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
|
print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
|
||||||
print '<td align="left" class="nowrap" width="20%"><input class="oddeven" name="check_SIZE_LISTE_LIMIT" id="check_SIZE_LISTE_LIMIT" type="checkbox" '.(! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"");
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_SIZE_LISTE_LIMIT" id="check_SIZE_LISTE_LIMIT" type="checkbox" '.(! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"");
|
||||||
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td><input class="flat" name="main_size_liste_limit" id="main_size_liste_limit" size="4" value="' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:'') . '"></td></tr>';
|
print '<td><input class="flat" name="main_size_liste_limit" id="main_size_liste_limit" size="4" value="' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:'') . '"></td></tr>';
|
||||||
|
|
||||||
|
// AGENDA_DEFAULT_VIEW
|
||||||
|
print '<tr class="oddeven">'."\n";
|
||||||
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_AGENDA_DEFAULT_VIEW" id="check_AGENDA_DEFAULT_VIEW" type="checkbox" '.(! empty($object->conf->AGENDA_DEFAULT_VIEW)?" checked":"");
|
||||||
|
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
|
print '<td>'."\n";
|
||||||
|
$tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||||
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
// Theme
|
// Theme
|
||||||
@ -308,12 +330,11 @@ else
|
|||||||
print '<tr class="liste_titre"><td width="25%">'.$langs->trans("Parameter").'</td><td width="25%">'.$langs->trans("DefaultValue").'</td><td> </td><td>'.$langs->trans("PersonalValue").'</td></tr>';
|
print '<tr class="liste_titre"><td width="25%">'.$langs->trans("Parameter").'</td><td width="25%">'.$langs->trans("DefaultValue").'</td><td> </td><td>'.$langs->trans("PersonalValue").'</td></tr>';
|
||||||
|
|
||||||
// Landing page
|
// Landing page
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
|
print (empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left" class="nowrap"><input class="oddeven" name="check_MAIN_LANDING_PAGE" disabled id="check_MAIN_LANDING_PAGE" type="checkbox" '.(! empty($object->conf->MAIN_LANDING_PAGE)?" checked":"");
|
print '<td class="nowrap"><input class="oddeven" name="check_MAIN_LANDING_PAGE" disabled id="check_MAIN_LANDING_PAGE" type="checkbox" '.(! empty($object->conf->MAIN_LANDING_PAGE)?" checked":"");
|
||||||
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
print empty($dolibarr_main_demo)?'':' disabled="disabled"'; // Disabled for demo
|
||||||
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -326,26 +347,35 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Language
|
// Language
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
$s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
||||||
print ($s?$s.' ':'');
|
print ($s?$s.' ':'');
|
||||||
print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left" class="nowrap"><input class="oddeven" type="checkbox" disabled '.(! empty($object->conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(! empty($object->conf->MAIN_LANG_DEFAULT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$s=(isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
|
$s=(isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
|
||||||
print ($s?$s.' ':'');
|
print ($s?$s.' ':'');
|
||||||
print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($object->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT):''));
|
print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):(! empty($object->conf->MAIN_LANG_DEFAULT)?$langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT):''));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Max size for lists
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
||||||
print '<td>'.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').'</td>';
|
print '<td>'.(! empty($conf->global->MAIN_SIZE_LISTE_LIMIT)?$conf->global->MAIN_SIZE_LISTE_LIMIT:' ').'</td>';
|
||||||
print '<td align="left" class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
print '<td>' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . '</td></tr>';
|
print '<td>' . (! empty($object->conf->MAIN_SIZE_LISTE_LIMIT)?$object->conf->MAIN_SIZE_LISTE_LIMIT:' ') . '</td></tr>';
|
||||||
|
|
||||||
|
// AGENDA_DEFAULT_VIEW
|
||||||
|
print '<tr class="oddeven">'."\n";
|
||||||
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
||||||
|
print '<td align="center"> </td>'."\n";
|
||||||
|
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(! empty($object->conf->AGENDA_DEFAULT_VIEW)?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||||
|
print '<td>'."\n";
|
||||||
|
$tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||||
|
if (! empty($object->conf->AGENDA_DEFAULT_VIEW)) print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
|
||||||
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -260,7 +260,7 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
|||||||
* @param string $type 1=GET, 0=POST, 2=PHP_SELF
|
* @param string $type 1=GET, 0=POST, 2=PHP_SELF
|
||||||
* @return int >0 if there is an injection
|
* @return int >0 if there is an injection
|
||||||
*/
|
*/
|
||||||
function test_sql_and_script_inject($val, $type)
|
function testSqlAndScriptInject($val, $type)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$inj = 0;
|
$inj = 0;
|
||||||
@ -310,55 +310,55 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
|||||||
$expectedresult=0;
|
$expectedresult=0;
|
||||||
|
|
||||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
|
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices';
|
||||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
$result=testSqlAndScriptInject($_SERVER["PHP_SELF"], 2);
|
||||||
$this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a');
|
$this->assertEquals($expectedresult, $result, 'Error on testSqlAndScriptInject 1a');
|
||||||
|
|
||||||
// Should detect XSS
|
// Should detect XSS
|
||||||
$expectedresult=1;
|
$expectedresult=1;
|
||||||
|
|
||||||
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
|
$_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction';
|
||||||
$result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2);
|
$result=testSqlAndScriptInject($_SERVER["PHP_SELF"], 2);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject 1b');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject 1b');
|
||||||
|
|
||||||
$test="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
$test="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa');
|
||||||
|
|
||||||
$test="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
$test="<img src='1.jpg' onerror =javascript:alert('XSS')>";
|
||||||
$result=test_sql_and_script_inject($test, 2);
|
$result=testSqlAndScriptInject($test, 2);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa2');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa2');
|
||||||
|
|
||||||
$test='<IMG SRC=# onmouseover="alert(1)">';
|
$test='<IMG SRC=# onmouseover="alert(1)">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa3');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa3');
|
||||||
$test='<IMG SRC onmouseover="alert(1)">';
|
$test='<IMG SRC onmouseover="alert(1)">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa4');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa4');
|
||||||
$test='<IMG onmouseover="alert(1)">';
|
$test='<IMG onmouseover="alert(1)">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa5');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa5');
|
||||||
$test='<IMG SRC=/ onerror="alert(1)">';
|
$test='<IMG SRC=/ onerror="alert(1)">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa6');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa6');
|
||||||
$test='<IMG SRC="  javascript:alert(1);">';
|
$test='<IMG SRC="  javascript:alert(1);">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject aaa7');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject aaa7');
|
||||||
|
|
||||||
$test='<IMG SRC=javascript:alert('XSS')>';
|
$test='<IMG SRC=javascript:alert('XSS')>';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject bbb');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject bbb');
|
||||||
|
|
||||||
$test='<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>';
|
$test='<SCRIPT SRC=http://xss.rocks/xss.js></SCRIPT>';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ccc');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject ccc');
|
||||||
|
|
||||||
$test='<IMG SRC="javascript:alert(\'XSS\');">';
|
$test='<IMG SRC="javascript:alert(\'XSS\');">';
|
||||||
$result=test_sql_and_script_inject($test, 1);
|
$result=testSqlAndScriptInject($test, 1);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ddd');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject ddd');
|
||||||
|
|
||||||
$test='<IMG """><SCRIPT>alert("XSS")</SCRIPT>">';
|
$test='<IMG """><SCRIPT>alert("XSS")</SCRIPT>">';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject eee');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject eee');
|
||||||
|
|
||||||
$test='<!-- Google analytics -->
|
$test='<!-- Google analytics -->
|
||||||
<script>
|
<script>
|
||||||
@ -371,30 +371,30 @@ class CoreTest extends PHPUnit_Framework_TestCase
|
|||||||
ga(\'send\', \'pageview\');
|
ga(\'send\', \'pageview\');
|
||||||
|
|
||||||
</script>';
|
</script>';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject eee');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject eee');
|
||||||
|
|
||||||
$test="<IMG SRC=\"jav\tascript:alert('XSS');\">"; // Is locked by some brwoser like chrome because the default directive no-referrer-when-downgrade is sent when requesting the SRC and then refused because of browser protection on img src load without referrer.
|
$test="<IMG SRC=\"jav\tascript:alert('XSS');\">"; // Is locked by some brwoser like chrome because the default directive no-referrer-when-downgrade is sent when requesting the SRC and then refused because of browser protection on img src load without referrer.
|
||||||
$test="<IMG SRC=\"jav
ascript:alert('XSS');\">"; // Same
|
$test="<IMG SRC=\"jav
ascript:alert('XSS');\">"; // Same
|
||||||
|
|
||||||
$test='<SCRIPT/XSS SRC="http://xss.rocks/xss.js"></SCRIPT>';
|
$test='<SCRIPT/XSS SRC="http://xss.rocks/xss.js"></SCRIPT>';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject fff1');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject fff1');
|
||||||
$test='<SCRIPT/SRC="http://xss.rocks/xss.js"></SCRIPT>';
|
$test='<SCRIPT/SRC="http://xss.rocks/xss.js"></SCRIPT>';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject fff2');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject fff2');
|
||||||
|
|
||||||
// This case seems to be filtered by browsers now.
|
// This case seems to be filtered by browsers now.
|
||||||
$test='<BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(1)>';
|
$test='<BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(1)>';
|
||||||
//$result=test_sql_and_script_inject($test, 0);
|
//$result=testSqlAndScriptInject($test, 0);
|
||||||
//$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject ggg');
|
//$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject ggg');
|
||||||
|
|
||||||
$test='<iframe src=http://xss.rocks/scriptlet.html <';
|
$test='<iframe src=http://xss.rocks/scriptlet.html <';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject hhh');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject hhh');
|
||||||
|
|
||||||
$test='Set.constructor`alert\x281\x29```';
|
$test='Set.constructor`alert\x281\x29```';
|
||||||
$result=test_sql_and_script_inject($test, 0);
|
$result=testSqlAndScriptInject($test, 0);
|
||||||
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on test_sql_and_script_inject iii');
|
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject iii');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user