26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
36$langs->loadLangs(array(
"companies",
"members",
"partnership",
"other"));
41$action =
GETPOST(
'action',
'aZ09');
42$confirm =
GETPOST(
'confirm',
'alpha');
43$cancel =
GETPOST(
'cancel',
'aZ09');
44$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'partnershipcard';
45$backtopage =
GETPOST(
'backtopage',
'alpha');
46$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
58$diroutputmassaction = $conf->partnership->dir_output.
'/temp/massgeneration/'.$user->id;
59$hookmanager->initHooks(array(
'partnershipthirdparty',
'globalcard'));
62$extrafields->fetch_name_optionals_label(
$object->table_element);
64$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
67$search_all =
GETPOST(
"search_all",
'alpha');
70foreach (
$object->fields as $key => $val) {
71 if (
GETPOST(
'search_'.$key,
'alpha')) {
72 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
77include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
79$permissiontoread = $user->hasRight(
'partnership',
'read');
80$permissiontoadd = $user->hasRight(
'partnership',
'write');
81$permissiontodelete = $user->hasRight(
'partnership',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
82$permissionnote = $user->hasRight(
'partnership',
'write');
83$permissiondellink = $user->hasRight(
'partnership',
'write');
84$usercanclose = $user->hasRight(
'partnership',
'write');
85$upload_dir = $conf->partnership->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
91if (!isModEnabled(
'partnership')) {
94if (empty($permissiontoread)) {
97if ($action ==
'edit' && empty($permissiontoadd)) {
100if (($action ==
'update' || $action ==
'edit') &&
$object->status != $object::STATUS_DRAFT) {
106$result =
restrictedArea($user,
'adherent', $id,
'',
'',
'socid',
'rowid', 0);
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
122if (empty($reshook)) {
125 $backtopage =
dol_buildpath(
'/partnership/partnership.php', 1).
'?rowid='.($id > 0 ? $id :
'__ID__');
128 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
131$object->fields[
'fk_member'][
'visible'] = 0;
132if (
$object->id > 0 &&
$object->status == $object::STATUS_REFUSED && empty($action)) {
133 $object->fields[
'reason_decline_or_cancel'][
'visible'] = 1;
135$object->fields[
'note_public'][
'visible'] = 1;
142$form =
new Form($db);
145$title = $langs->trans(
"Partnership");
148$form =
new Form($db);
151 $langs->load(
"members");
156 if (isModEnabled(
'notification')) {
157 $langs->load(
"mails");
164 print
dol_get_fiche_head($head,
'partnership', $langs->trans(
"ThirdParty"), -1,
'user');
166 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
168 dol_banner_tab($object,
'rowid', $linkback);
170 print
'<div class="fichecenter">';
172 print
'<div class="underbanner clearboth"></div>';
173 print
'<table class="border centpercent tableforfield">';
177 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
$object->login.
' </td></tr>';
181 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
184 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.
$object->getmorphylib().
'</td>';
188 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
$object->company.
'</td></tr>';
191 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
' </td>';
205if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
208 if ($action !=
'presend') {
209 print
'<div class="tabsAction">'.
"\n";
210 $parameters = array();
211 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
216 if (empty($reshook)) {
218 if ($permissiontoadd) {
219 print
dolGetButtonAction($langs->trans(
'AddPartnership'),
'',
'default', DOL_URL_ROOT.
'/partnership/partnership_card.php?action=create&fk_member='.
$object->id.
'&backtopage='.urlencode(DOL_URL_ROOT.
'/adherents/partnership.php?id='.
$object->id),
'', $permissiontoadd);
229 print
load_fiche_titre($langs->trans(
"PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv(
"Partnership")), $morehtmlright,
'');
237 $partnershipid =
$object->fetch(0,
"", $memberid);
239 if ($partnershipid > 0) {
240 print
'<div class="fichecenter">';
241 print
'<div class="fichehalfleft">';
242 print
'<div class="underbanner clearboth"></div>';
243 print
'<table class="border centpercent tableforfield">'.
"\n";
249 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
253 $fadherent->fetch(
$object->fk_member);
254 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
255 if ($fadherent->datefin) {
257 if ($fadherent->hasDelay()) {
258 print
" ".img_warning($langs->trans(
"Late"));
261 if (!$adht->subscription) {
262 print $langs->trans(
"SubscriptionNotRecorded");
263 if ($fadherent->statut > 0) {
264 print
" ".img_warning($langs->trans(
"Late"));
267 print $langs->trans(
"SubscriptionNotReceived");
268 if ($fadherent->statut > 0) {
269 print
" ".img_warning($langs->trans(
"Late"));
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
Class to manage members type.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.